>Thanks Mark, for the reply. However, this technique gives me not a unique count but a full count of all the visits for all the users. I'm sorry I did not make this more clear. I'm trying to get an unduplicated count from a table of visits of the clients who made those visits. I understand how to get a grand total by simply counting up the distinct ids before I even run the report, but I'm wondering if it's possible within the report to get an unduplicated count within the groupings using the group headers.
>
>Diana
I am confused. The count distinct id will give you how many unique clients have visited. Do you want how many visits each client has made? If so, how about:
select id, count(id) Kount from mycursor group by id into array aCount
The assumption that there is exactly 1 record per client visit even if there are multiple visits per day. I also assume the ID is the client ID and not a primary key.
>>>I'm trying to figure out how to give my clients a count of individuals from a report that shows visits. I understand the concept of:
>>>select count(distinct id) from mycursor into array aCount,
>>>
>>>but that only gives me the grand total. On my report I've got groups of Insurance Sponsors and then within those, groups of age ranges. I would like to give distinct counts within those groups. I'm assuming I can add variables to my report - aCount for one, but how do I refer to the group header variables? I'm thinking my subtotal counting variable would be updated at the 'on entry' part of the group header and would look something like:
>>>
>>>select count(distinct id) from mycursor into array aCount where nprimary = nprimary.
>>>
>>>The group header breakpoint is nprimary. I know this expression won't work because the report shouldn't know the difference between the nprimary references. Anyone have any ideas?
>>>
>>>TIA
>>>Diana
>>
>>Create a data grouping in your report. Copy one of the fields from the detail band into the group summary. Double-click on the field in the group summary band. Click the Calculations button. Check the Count box.
Mark McCasland
Midlothian, TX USA