Skip to content
Advertisement

Generate One year dates using Oracle SQL

I have a table with three ID and Dates i want generate dates of one year from current date and before and after six months Then i want to plot three dates on this one year generated calandar I tried

Advertisement

Answer

The concept of “month” is variable, so you may want to double check if “6 months” is really what you’re looking for. It can give unexpected results if you don’t know the oddities of date math.

That being said, a calendar which contains 6 months on either side of the current date can be generated with the following. Note that 184 days is the longest a 6 month span can last (July-December).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement