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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about using the Month function.

Status
Not open for further replies.

Chelsea7

Programmer
Aug 25, 2008
69
US
Hello, I have a question about querying Month and Year. In the criteria, I want to query everything from let's say this month to previous months and year. I used this;

<=now()

This works but of course it's based on the current systems date. I need it to give me the entire current month. So if I query now it will only give me records 11/21/2010 and older. However, there are records with the Due_Date field 11/30/2010. I need to include this in the query. In other words the entire month and year to previous months. Is there anyway to do this without creating a field on a form?

If tried using Month(date()) but the result is the same as using Now().

I prefer to use the criteria section and not VBA. Any assistance will be appreciated.

 
The last day of the current month:
<=DateSerial(Year(Date()), Month(Date()) + 1, 0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top