query for current month

  • Thread starter Thread starter rciolkosz
  • Start date Start date
R

rciolkosz

I have a full date.time stamp field and need a query to only pull records for
the current month and following month.
 
The Following should work

Field: YourDateField
Criteria: >= DateSerial(Year(Date()),Month(Date()),1) AND <
DateSerial(Year(Date()),Month(Date())+ 2,1)


OR if your field never has midnight as the time
Field: YourDateField
Criteria: Between DateSerial(Year(Date()),Month(Date()),1) AND
DateSerial(Year(Date()),Month(Date())+ 2,1)

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
I understand that. I want to use the computer time so that the query will
automatically display the current month plus the next.
 
DateDiff("m", now, yourDate) IN (0, 1)




will return true if your date is in the current month, or in the next month.



Hoping it may help,
Vanderghast, Access MVP
 
AWESOME! PERFECT. Thank you

John Spencer said:
The Following should work

Field: YourDateField
Criteria: >= DateSerial(Year(Date()),Month(Date()),1) AND <
DateSerial(Year(Date()),Month(Date())+ 2,1)


OR if your field never has midnight as the time
Field: YourDateField
Criteria: Between DateSerial(Year(Date()),Month(Date()),1) AND
DateSerial(Year(Date()),Month(Date())+ 2,1)

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Back
Top