I have dates in a table that are stored as decimal years. An example is 2003.024658
which translates to January 9, 2003
.
I would like to convert the decimal years to Oracle's date format.
I've found someone who's done this in Excel: Decimal year to date formula?
=DATE(INT(B1),1,MOD(B1,1)*(DATE(INT(B1)+1,1,1)-DATE(INT(B1),1,1)))
However, I can't quite figure out how to convert the logic to Oracle PL/SQL.
2003.024658
toJanuary 9, 2003
? – StonwinSELECT TO_DATE ('31-DEC-2002') + (0.024658 * 365) FROM DUAL
gives output09-Jan-2003
. – Ammunition0.024658
) was originally calculated by whoever recorded the values in the first place - e.g. on a simple 365 days/year, or some average estimate like 365.24, or perhaps some other scheme. – Uremia