Counting Records in a Date Range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to count records with-in a date range. How would I set up the control
source? Thanks in Advance for your assistance.
 
Try this kind of thing:
=DCount("*", "Table1", "[MyDateField] Between #1/1/2005# And #12/31/2005#")

If the dates are in text boxes:
=DCount("*", "Table1", "[MyDateField] Between " &
Format([StartDate], "\#mm\/dd\/yyyy\#") & " And " &
Format([EndDate], "\#mm\/dd\/yyyy\#"))
 
Since this is a Reports news group, I can only assume you want to count the
records in your report in a Date Range. If this is the case then you can
use:
=Sum(Abs( [MayDateField] Between #1/1/2005# AND Date()) )

If Allen or my replies don't help then consider providing more information.

--
Duane Hookom
MS Access MVP


Allen Browne said:
Try this kind of thing:
=DCount("*", "Table1", "[MyDateField] Between #1/1/2005# And
#12/31/2005#")

If the dates are in text boxes:
=DCount("*", "Table1", "[MyDateField] Between " &
Format([StartDate], "\#mm\/dd\/yyyy\#") & " And " &
Format([EndDate], "\#mm\/dd\/yyyy\#"))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lakenheath said:
I need to count records with-in a date range. How would I set up the
control
source? Thanks in Advance for your assistance.
 
Back
Top