Hello. Customer has shortcuts in their data where they have a quantity of records in a field. When I parse them, I need to manufacture records, one for each quantity, incrementing the "identifier" by 7 days (because the number represents a date.
Example: a single product that is on sale for four weeks and I need four records, one product for each week.
[Event Number]
[Classification]
[Weeks Running]
[Some Data]
2009 11 29 00
1
1
runs one week
2009 12 06 00
2
1
runs one week
2009 12 13 00
1
4
runs four weeks
2009 12 20 00
2
4
runs four weeks
Somehow I need to turn this data into the following with a view (sql select) (all in the same table, white space included to see parts:
[Event Number + Classification]
[Some Data]
2009 11 29 01
runs for one week One week thus one record.
2009 12 06 02
runs for one week
2009 12 13 01
runs for four weeks Repeats 4 times incrementing date by 7
2009 12 20 01
runs for four weeks
2009 12 27 01
runs for four weeks
2009 01 03 01
runs for four weeks
2009 12 20 02
runs for four weeks Repeats 4 times incrementing date by 7
2009 12 27 02
runs for four weeks
2009 01 03 02
runs for four weeks
2009 01 10 02
runs for four weeks
My thoughts are to have some sort of pivot cross apply sql code?