Hi All,
I looked in the forums if some one used CREATE_CHUNKS_BY_SQL for dates, but no luck.
I am actually looking to update a table by using chunks of dates.
For which I need to generate date ranges to split them by chunks.
I have a table where I know max(sales_date) and min(sales_date).
Lets say max(sales_date) : 1/1/2008 min(sales_date) : 10/31/2010
I want to split them into 6 month(180 days) intervals as below :
chunk_id start_date end_date
-------- ---------- --------
1 01/01/2008 06/30/2008
2 01/07/2008 12/31/2008
3 01/01/2009 06/30/2009
4 01/07/2009 12/31/2009
5 01/01/2010 06/30/2010
6 01/07/2010 10/31/2010
It does not have to end exactly by month end. Basically I need those date ranges to be apart 180 days.
I appreciate if someone can throw some ideas on this.
Thanks,
Raj.