Wednesday, November 9, 2011

Convert JULIAN to standard date using SQL….

EnterpriseOne stores dates in Julian using the following format CYYDDD (“C” is the century, “YY” is the year and “DDD” is the number of days since the start of the year).
To convert a julian date to a standard (gregorian) date format:

TO_CHAR(TO_DATE(XXXXXX+1900000,’YYYYDDD’),’MM-DD-YYYY’)

Notes:
- where XXXXXX is the column name to convert.
- this only works on 19th century onwards.

if you need help putting it in a query lemme know…

No comments:

Post a Comment