Returning Counts of different criteria

Glowackattack

Registered User.
Local time
Today, 16:06
Joined
Feb 26, 2008
Messages
126
Hi,
I have a query built and what i want to do is count the number of records that meet date criteria. To illustrate, these are the fields i need

Company, Branch, Count of records within past month, Count of records within past 3 months, count of records within past year, Count of records within past 2 years, etc.

I'm trying to do this using the Dcount function to compute each of the count fields

Cnt_PastMonth: DCount("Company","Tbl_Caseoverview","[Tbl_CaseOverview]![Placed Date] > " & DateAdd("m",-1,Date()))

Cnt2_Past12Months: DCount("Company","Tbl_Caseoverview","[Tbl_CaseOverview]![Placed Date] > " & DateAdd("m",-12,Date()))

My second count field shows up as dates and not as integers when the query is run...

Am I doing this correctly?? Or is there a better way to do it??

Thanks for your help in advance,
 
use a cross tab query. that way you can have your count function as the global and the timeframes across the top
 
Thanks Adam, i havent used those before, i'll have to look it up.
 

Users who are viewing this thread

Back
Top Bottom