Month to date query

  • Thread starter Thread starter hotplate
  • Start date Start date
H

hotplate

Hi,

I am trying to write a query that does a count of occurrances for each
day in a month starting on the first day of the month. How do you set
the criteria to the first day of the current month through the current
date? or the first day of the month though the last day of the month?
which ever is easier.

James
 
And if you want the end of the month, you can use
DateSerial(Year(Date()),Month(Date())+1,0)
That works since the zero day of the next month is the last day of the
previous month. Or you can think of it as
DateSerial(Year(Date()),Month(Date())+1,1) - 1
Which can be restated thanks to the magic of DateSerial as
DateSerial(Year(Date()),Month(Date())+1,1-1)


Between DateSerial(Year(Date()),Month(Date()),1) And
DateSerial(Year(Date()),Month(Date())+1,0)
 
Back
Top