Only return data for current month

mark curtis

Registered User.
Local time
Today, 00:12
Joined
Oct 9, 2000
Messages
457
Can anyone tell me how to return values for the current month in a query. Is there any criteria like the Now() or Date() format?

Thanks
 
There are a couple of ways to do it. The easiest is to use the Month function in a query expression.

For example say you have a field with date information called dtDate. Create an expression in a blank query field like this.
intMonth: Month([dtdate]). This will return an integer equal to the month. In the criteria cell for the same query field use an expression like this. Month(Now()).

Hope that helps
 
You also need to include year in the criteria.

Where Month(YourField) = Month(Date()) and Year(YourField) = Year(Date());

Use the Date() function rather than Now() since you don't need time.
 
Can you be more clear on this? I've been trying and I can't get it to work. I'm not sure if I am doing the right thing.
 

Users who are viewing this thread

Back
Top Bottom