>If I reset on AgentID and Customer# then I will only get the number of policies to a each unique AgentID and Customer#. Not the number of unique customers. If I have 1 Agent, 3 Customers, and 10 policies ( a query of 10 records), I want my report to display only 1 line.
>
> Agent # of Customer # of Policies
>Joe Smith 3 10
>
>Any help would be appreciated.
If you have the separate report cursor, you may use UDF's called from the report fields to get those numbers. Report field expression for # of Customer"would be:
customers_count(myReportCursor.agentID)
FUNCTION customers_count && say, in you procedure file
PARAMETER tAgentID
local lacount[1]
lacount[1] = 0
SELECT COUNT(customerID) ;
FROM myDataTable ;
WHERE myDataTable.AgentId = tAgentId ;
INTO ARRAY lacount
RETURN lacount[1]
ENDFUNC
I often use this trick.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison