Counting Field Values per type

edited 11:20PM in FastReport VCL
Hello,

I have a master detail report. Articles are listed in detail band.
At the end of the report, I would like to display a summary showing the number of devices per article.

Here is a similar example: http://www.databasedev.co.uk/count_values_countiif.html

How can I solve this with FastReport?

Thank you

Comments

  • edited 11:20PM
    Do you have a fixed set of groupings, as in the example (male / female) or is it a variable number based on the returned rows?

    Since it also sounds as if you want the summation to be across all the master-data bands, not just within the given master's detail rows, have you looked at creating a secondary query that simply counts the "device" rows in the detail table?
    e.g.
      select device, count(device) from Details 
      where <insert whatever filtering necessary>
      group by device
    

    Then display this as a sub report after the Master/Detail bands.
  • edited 11:20PM
    Thank you, the second query is the perfect solution for me >

Leave a Comment