Hey all,
I'm trying to create a query that will pull data in 3 month chunks. The function would be run on the 1st of the month (every month) and pull the previous 3 months work of data.
The issue is that I need the Query Dynamic (such as using the Date() command) so that I don't need to update the Query each month, and the query needs to handle 'weird' month lengths, and pull everything up to midnight...
For example, if today was 11/1/04. I would need to pull all data from 7/1/04 12:00:00 AM THOUGH 10/31/04 11:59:59 PM
I was thinking something like this:
on the where clause..but this doesn't seem to work right..
The PogoWolf
I'm trying to create a query that will pull data in 3 month chunks. The function would be run on the 1st of the month (every month) and pull the previous 3 months work of data.
The issue is that I need the Query Dynamic (such as using the Date() command) so that I don't need to update the Query each month, and the query needs to handle 'weird' month lengths, and pull everything up to midnight...
For example, if today was 11/1/04. I would need to pull all data from 7/1/04 12:00:00 AM THOUGH 10/31/04 11:59:59 PM
I was thinking something like this:
Code:
Between CDate(DateAdd("m",-3,Date()) & " 12:00:00 AM") And CDate(DateAdd("d",-1,Date()) & " 11:59:59 PM")
on the where clause..but this doesn't seem to work right..
The PogoWolf