I working with huge records of data and using INDB tools. I want to convert Julian date to Standard date format which I have achieved using Formula Tool but facing challenge to achieve same in Formula IN-DB tool. It will be really helpful if somebody suggest solution :
Standard Formula Tool
Year : IF Left([JD], 1) == '1' THEN '20' ELSE '19' ENDIF
Date : ToString(ToNumber([StartYear] + Substring([JD],1,2))-1)+'-12-31'
FinalDate : DateTimeAdd([StartDate],ToNumber(Substring([JD],3,3)),'days')
Solved! Go to Solution.
could you share the in-db connection you are using, is it oracle, mysql, something else?
Stack overflow gave me this answer:
cheers,
mark
SELECT TO_DATE(1900+(DATE/1000),1,1)+TO_NUMBER(SUBSTR(TO_CHAR(DATE),4))-1 FROM DUAL;
I wrote below code and have achieved standard date format using formula-indb tool
to_char(to_date(to_char(1900 + floor("JulianDate" / 1000)),'YYYY') + mod("JulianDate",1000) -1,'YYYY-MM-DD')