sort data in date range [message #438024] |
Wed, 06 January 2010 19:18 |
chirutha
Messages: 1 Registered: January 2010
|
Junior Member |
|
|
Hi All,
I have an interesting and unsolved problem.
My cursor fetches data in the following format.
qty customer startdate enddate
100 smith 10-Jan-2010 10-Jan-2020
-100 chris 10-Jan-2010 31-May-2011
200 ruan 01-Jan-2011 25-Jul-2016
I now have to sort out this data and insert into a table in such a way that when i enter 2 dates (say 10-Jan-2010 to 31-May2013), i should get sum(qty) for which the dates entered falls under the ranges given in the question at day wise.
Suppose if i give the dates 01-Jun-2011 till 30-Jun-2011,
i should get 30 rows with each qty as 100+200. (as second period is not falling in this )
Please help
|
|
|
|
|
Re: sort data in date range [message #438107 is a reply to message #438024] |
Thu, 07 January 2010 02:59 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
I'm a little unclear about what you're trying to do, but you definitely want some sort of RowGenerator
You use the Row generator to return one row for each date between the two ranges, and then join to your original table using this date to get the rows that you want.
|
|
|
|