jonnymenthol
Registered User.
- Local time
- Today, 08:02
- Joined
- Oct 31, 2001
- Messages
- 58
Hello,
I have a query which pulls data based on a date range.
However, instead of using this, I'd like to only get data for last month.
I have tried doing this by adding 2 fields :
In each of these fields I have added a criteria of :
This allows me to get the data for last month (say February), but also ensures it is only the data for this year. (as the DB holds data for the past 4 or 5 years)
The problem is though, when the year rolls over to January, this will not work.
Can anyone shed any light on an alternative please ?
Thanks,
J.
I have a query which pulls data based on a date range.
However, instead of using this, I'd like to only get data for last month.
I have tried doing this by adding 2 fields :
Code:
Month: Month(myDate)
and
Year : Year(myDate)
Code:
Month(Date())-1
and
Year(Date())
This allows me to get the data for last month (say February), but also ensures it is only the data for this year. (as the DB holds data for the past 4 or 5 years)
The problem is though, when the year rolls over to January, this will not work.
Can anyone shed any light on an alternative please ?
Thanks,
J.