Date calculation - Logic required
Posted: Wed May 20, 2009 7:08 pm
Whenever I run the job, the start date and end date should be generated based on the current date.
If I run the job on (Date: 06/01/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jun + Jul, Aug, Sept 09
Previous 3 Months : Mar, Apr, May 09
Start date : Mar -01 - 2009
End Date : Sep - 30-2009
If I run the job on (Date: 06/02/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jun + Jul, Aug, Sept 09
Previous 3 Months : Mar, Apr, May 09
Start date : Mar -01 - 2009
End Date : Sep - 30-2009
If I run the job on (Date: 07/01/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jul + Aug, Sept, Oct 09
Previous 3 Months : Apr, May, Jun 09
Start date : APr -01 - 2009
End Date : Oct - 31-2009
Note: Start date should be first date of the previous third month
and end date should be the last date of the next third month.
(This excludes the current month and should always pull 7 months data).
I am not sure how to do it.
Please help
If I run the job on (Date: 06/01/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jun + Jul, Aug, Sept 09
Previous 3 Months : Mar, Apr, May 09
Start date : Mar -01 - 2009
End Date : Sep - 30-2009
If I run the job on (Date: 06/02/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jun + Jul, Aug, Sept 09
Previous 3 Months : Mar, Apr, May 09
Start date : Mar -01 - 2009
End Date : Sep - 30-2009
If I run the job on (Date: 07/01/09 ), then Load the data for 7 Months
Current Month + Next 3 Months : Jul + Aug, Sept, Oct 09
Previous 3 Months : Apr, May, Jun 09
Start date : APr -01 - 2009
End Date : Oct - 31-2009
Note: Start date should be first date of the previous third month
and end date should be the last date of the next third month.
(This excludes the current month and should always pull 7 months data).
I am not sure how to do it.
Please help