Home RAP

Distinct Count Function


How can I include a distinctcount function in rap?




  • 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
  • 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?


  • 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
Sign In or Register to comment.