Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a table with the following:
ID, Hours, Start Date, End Date
1 20 01/01/2013 01/19/2013
2 25 04/30/2013 06/01/2013
I need to produce a table to show a row for everyweek between the start and the end periods
Like the following for the first ID
ID, Hours, Start Date, End Date, Weekend Date
1 20 01//01/2013 01/20/2013 01/05/2013
1 20 01/01/2013 01/20/2013 01/12/2013
1 20 01/01/2013 01/20/2013 01/19/2013
Thxs fr all your help in advance..
Alec
Try something along these lines:
Set DateFormat = 'MM/DD/YYYY';
LOAD *,
Date(WeekEnd(StartDate,0,6)+(iterno()-1)*7) as WeekendDate
INLINE [
ID, Hours, StartDate, EndDate
1, 20, 01/01/2013, 01/19/2013
2, 25, 04/30/2013, 06/01/2013
]
WHILE WeekEnd(StartDate,0,6)+(iterno()-1)*7 <= weekend(EndDate,0,6)
;