Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign Days to Calendar Month

Hi there

If I have a row with a start date of 25/4/2016 and an end date of the 3/5/2016

How would I go about splitting this into calendar days

The output I would like to see is as follows;

Row_ID      April-16     May-16     Total

123               5               3                8

etc

I would have thousands of rows of data so would need some kind of loop I would imagine

Thanks,

Aidan

4 Replies
marcus_sommer

You could use IntervalMatch to map these data to a calendar.

- Marcus

Kushal_Chawda

Data:

LOAD Row_ID,

          StartDate,

          EndDate,

         (StartDate +iterno()-1) as Date

FROM table

while StartDate +iterno()-1<=EndDate;

Not applicable
Author

Thanks Kushal

In some cases I would only have 7 of the 8 days available to use/select from

How would I get around this?

Thanks,

Aidan

Kushal_Chawda

I did not get you. Can you give example?