Count Invoices

pekajo

Registered User.
Local time
Today, 15:58
Joined
Jul 25, 2011
Messages
137
Hi,
Can you help me. I need to count the number of invoices to a client for a report. eg
fldclient fldInvoice#
1 101
1 110
1 123
2 113
2 115


count client 1 has 3 invoices
client 2 has 2 invoices
etc

The dcount does not appear to be the answer.

Thanks for any help
Peter
 
If you want report to list detail records as well as summary calcs, set report to group on fldClient and use Count() aggregate function in group header or footer section.
 
A simple grouped query will do this;

Code:
SELECT fldClient, Count(fldInvoice#) as NoOfInvoices
From YourTable
Group By fldClient

As a word of advice remove any special characters from your field names like # % etc.
 
or you can use Group (group by fldClient) on your report and do the count.
 

Users who are viewing this thread

Back
Top Bottom