I have a julian dates stored in the format YYDDD numeric, 5 positions, zero decimal. How do I convert to a true Gregorian date in DB2 Web Query for iSeries?
The following link is to a draft of a Redbook for DB2 Web Query. Chapter 12 has info on data manipulation.
http://www.redbooks.ibm.com/redpieces/pdfs/sg247214.pdf
In addition, youu can manipulate dates in the Report Assistant using a computed field. Create a new computed field and in the box where the calculation is needed put something like this:
JULIAN/I5 = JULDAT(<i>YOUR_DATE_FIELD</i>, JULIAN);
AND
GREG_DATE/I8 = GREGDT(JULIAN, 'I8');
Last Wiki Answer Submitted: December 6, 2007 7:46 pm by WaltZ400645 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Thanks, WaltZ. I read that section but it seems to be only for the developer workbench, which we don’t have.
RPGLE julian date conversion code:
D Wprthr S 8 0 Inz(20101115)
D Xcjul S 7 0
/Free
Xcjul = %Dec(%Subst(%Char(Wprthr):1:4):4:0) * 1000 +
%Diff(%Date(Wprthr):
%Date(%Dec(%Subst(%Char(Wprthr):1:4):4:0)
* 10000 + 0101) :*D) + 1;
XCJUL = 2010319