AS400 QUERY-Beginning of year date

35 pts.
Tags:
AS/400
AS/400 Query
WRKQRY
How can I create a date field with the 1st day of the current year ie: 01/01/2009 using WRKQRY. Thanks!

Answer Wiki

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

<b>Thanks! It worked perfectly!</b>

Hi,

This should work for you. You may have to change the substring position depending on your date format :-

<pre>
Field Expression Column Heading Len Dec
YEARSTART ’01/01/’ || SUBSTR(
CHAR(CURRENT(DATE)), 1, 2)

</pre>

Regards,

Martin Gilbert.

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