Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Distinct Count Function

Hi,

How can I include a distinctcount function in rap?

Thanks,

Ken

Comments

  • Hi Ken,

    I'm a bit unclear about your question. "DistinctCount" seems like more of a SQL command rather than a Delphi routine (which is what RAP is for). Are you looking to add a DistinctCount command into a SQL query from RAP?
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nard,

    I haven't been able to successfully use the sql count(distinct xxx). Is there a way?

    So I thought maybe I could do it in RAP instead.

    Any ideas?

    Thanks,

    Ken
  • Hi Ken,

    From Query Designer select the Calc page. Add a calc field. Use the mouse to select the function combobox. Either type the expression there or press the '...' button to access the SQL editor and enter the expression there.

    You can also do this from RAP by using TdaSQLBuilder class. Something like SQLBuilder.CalcFields.AddExpression(FieldAlias, Expression).

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
Sign In or Register to comment.