SQL - Number To Date
My database is Oracle 10g. DATE is stored NUMBER datatype on a table and I need to access this number and display it in Date format using SQL.
Pls Can anyone help?
> SELECT SLIVD FROM
What is the date format? 10 could be month, year or date, but 80 and 90 would only work in the year portion. i.e. 1980/1990. If you are dealing with a number, and it is properly formatted using the to_date('20080507', 'YYYYMMDD') will work. You just need to know that format that the numbers are in otherwise...
SQL> SELECT TO_DATE('108090', 'MMDDYY') from dual;
SELECT TO_DATE('108090', 'MMDDYY') from dual
ERROR at line 1:
ORA-01847: day of month must be between 1 and last day of month
The field SLIVD (Invoice date) is given date format (Ex: 24/12/2007).
But, the date is stored in database is ‘107358’ (SLIVD - NUMBER - data type).
How to select date format from data base?
>SELECT SLIVD FROM F42199 WHERE SLDOCO=206 ANS SLMCU=11090
I have no idea what "SLIVD - NUMBER - data type" is. I'm guessing it isn't an Oracle support way of storing dates. So if you want help writing a function to do the conversion, then you need to explain the format. How does someone convert from SLIVD to a gregorian date?