Converting Julian date to Gregorian in WRKQRY

15 pts.
Tags:
AS/400 date format
AS/400 queries
Date format
WRKQRY
I work on an Iseries AS/400 and when I do a wrkqry for reports I need to convert the date ccyyyddd(julian) to mmddyyy(gregorian)

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’m NOT an AS/400 guy but…
Try these:

A Standard query can do that for you. Go to “Define result fields” and create these fields. GLDGJ would be your Julian date field, and GLDAT would be your new work field. Works for pre-and post 2000.
To convert a Julian date to a normal date in query:

NDAT 1900000 + gldgj 7 0

CDAT digits(ndat)

GLDAT date(cdat)

Source: Converting Julian dates in query

These might be helpful as well.

Julian Day Calculations

Good Luck!
-Flame

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following