Avatar of edoc_admin
edoc_admin
 asked on

Convert number to date in Oracle

Hello,
I have a table whose date fields are all declared as NUMBER. For example, the value 14076 is supposed to represent 16-Jul-2008. I'm not sure how this number was created - whether it was internally created by the system or it was converted using TO_DATE / TO_NUMBER functions. I'd like to convert this number to a date (i.e. from 14076 to 16-Jul-2008). Could you please help ?
The Oracle version I'm using is 9.2.0.8.

Your assistance is greatly appreciated.


Oracle Database

Avatar of undefined
Last Comment
Sean Stuber

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
edoc_admin

ASKER
Hi sdstuber,

It works. If you don't mind, could you please explain the logic of your SQL statement ?
1) Why Jan 1, 1970 particularly ?
2) And how was this N number calculated in the first place i.e. from 16 Jul 08 to 14076 ?

Thank you for your help.
SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23