Re: Looping Over a Series of Dates
Actually, not homework. I need to project potential billing dates.
Anyway, I came up with a solution that required me to create a table that contains a sequence. I then determined how many 28 day periods there were in the range and joined that to the table that contained the list of start dates.
LEFT JOIN sequence_table st ON st.id < (fd.periods + 1)
Then selected a table that was the number from the sequence table times 28. *Since the start date was the first billing date, I had to subtract one from the sequence. In hindsight, I could have started the sequence at 0...
fd.startDate + INTERVAL ((st.id - 1) * 28) DAY as billingDate
I think this portion of my select statement would accomplish the same thing that Date_Add() would.
Subject
Written By
Posted
Re: Looping Over a Series of Dates
July 13, 2018 05:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.