Creating date ranges
Posted: Wed Aug 07, 2013 3:27 am
Hi,
In one of my job my date format like below
2011-07-03
2011-08-03
2011-09-03
2011-10-03
2011-11-03
Now I need to compare the data between the current and previous data.
I need to take first row date(2011-07-03) as my start date and the next row date need to load as a end date before that I have minus one date for that (2011-08-02)
so output will be
Start Date End Date
2011-07-03 2011-08-02
2011-08-03 2011-09-02
2011-09-03 2011-10-02
2011-10-03 2011-11-02
2011-11-03 2011-11-03
Can anyone help me how to do this logic?
In one of my job my date format like below
2011-07-03
2011-08-03
2011-09-03
2011-10-03
2011-11-03
Now I need to compare the data between the current and previous data.
I need to take first row date(2011-07-03) as my start date and the next row date need to load as a end date before that I have minus one date for that (2011-08-02)
so output will be
Start Date End Date
2011-07-03 2011-08-02
2011-08-03 2011-09-02
2011-09-03 2011-10-02
2011-10-03 2011-11-02
2011-11-03 2011-11-03
Can anyone help me how to do this logic?