cant filter using Month(Now())

icemonster

Registered User.
Local time
Today, 03:54
Joined
Jan 30, 2010
Messages
502
is it possible my access time is messed up? because i know for a fact that there are records that should get filtered but am not getting anything? i even tried a year.

@_@
 
K. G.

When you want to filter by the month, first create a column in your recordsource query that returns only the Month from your date field:
Month: Month(YourDateFieldHere)

This will return the number of the month in that new column and then you can use criteria in that colum of the month you want to filter the records for.
 
I think I already encountered that.. I used this criteria.

Year([SalesDate]) = Year(Now()) And Month([SalesDate]) = Month(Now())

Replace SalesDate with the name of your field...
 
rheeyum: You should use Date() instead of Now() for your query.

Code:
Year([SalesDate]) = Year(Date()) And Month([SalesDate]) = Month(Date())
 
rheeyum: You should use Date() instead of Now() for your query.

Code:
Year([SalesDate]) = Year(Date()) And Month([SalesDate]) = Month(Date())

ahahaha, actually I don't know the difference vbaInet but that things works for me. I just saw that criteria from microsoft. I am just a bit unsure what would be the difference or the effect of it. My users seem to be very happy with the monthly query = )
 
The difference is Date() would only return a date but Time() returns both a date and time values. It just helps the computation. There are circumstances you need to use just Date().
 

Users who are viewing this thread

Back
Top Bottom