I have a numeric field in my Oracle database that represents the number of days since Dec 28, 1800. However I am trying to select it (for another application) as the current date it represents. I’m not too familiar with Oracle commands (I’m used to SQL), so I was wondering if anyone could provide some assistance. Thanks.
ex: 77650 = Saturday, August 3, 2013
Firstly, get this out of the way, your life would be easier if you stored dates in a date data-type.
However, to answer your question to add days to a date in Oracle you can use the
+operator.Firstly though you have to have a date so I’ll convert the 28th December 1800 into a date using to inbuilt
to_datefunction then add the number. In your case you would want:I’ve set up a little SQL Fiddle to demonstrate for you.