Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple count calculations in 1 query

Status
Not open for further replies.

tbellomo

Technical User
Jan 28, 2002
73
US
Hello,
I am a fairly versed Access user, but I always have problems with my reporting queries, namely, counting what needs to be counted.
I need to count the number of records created/updated today, yesterday, this week, and year to date. Do I have to create a different query to get each number? Is there a simpler way.

So, to sum up, i have a "created date" field and an "updated date" field, and need to put the count of records created and updated in each time frame in a report. Any advice?

Thanks a million,
tim
 
You could use DCount("FieldName","TableName","DateCreated Beteween #" & format(StartDate,"mm/dd/yyyy")) "# And #" & Format(EndDate,"mm/dd/yyyy")) & "#")

StartDate and EndDate will represent the range of dates.
You can extend the criteria to whatever you like.

But remember...the more DCounts you use, the slower your query will run...

Good luck

[pipe]
Daniel Vlas
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top