We help IT Professionals succeed at work.

Convert number to date in Oracle

edoc_admin
edoc_admin asked
on
10,395 Views
Last Modified: 2013-12-19
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.


Comment
Watch Question

Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.