I have the query below that I want to schedule to run on the 20th of every month, where the dates for the query should be the start date and the end date of the prior month.
If run on 10/20/2011, start date = 9/01/2011 end date = 09/30/2011.
Is there a way to accomplish this so I can schedule this job and know it will pull data from the desired date range each month?
---------
select * from Table
where [Posted Date] between '2011-09-01 00:00:00.000' and '2011-09-30 00:00:00.000'
---------
Thanks,
Andrew
If run on 10/20/2011, start date = 9/01/2011 end date = 09/30/2011.
Is there a way to accomplish this so I can schedule this job and know it will pull data from the desired date range each month?
---------
select * from Table
where [Posted Date] between '2011-09-01 00:00:00.000' and '2011-09-30 00:00:00.000'
---------
Thanks,
Andrew