How To…Count Distinct Records

Question

“How do I count only the distinct records in my dataset using ReportBuilder?”

Solution

Keep track of the distinct records using a TStringList object.

Download: CountDistinct.zip

Sample Delphi code: