Adding today’s date in a query that’s outputing a work file

5 pts.
Tags:
AS/400
I run a query that outputs a work file. How can I add a date in the format of YYYYMMDD or 'YYYY-MM-DD'?
1

Answer Wiki

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

I’ve used these 2 methods depending on needs.

TODAYISO    CHAR(CURRENT(DATE),ISO)
for
2015-07-07                              

TODAY       CHAR(CURRENT(DATE))   
for
07/07/15 

Discuss This Question: 2  Replies

 
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.
  • pdraebel
    I would suggest you look at creating a QMQRY. It has more possibiliies than a regular query.
    7,545 pointsBadges:
    report
  • RossHowatson

    Try the following (in the Define Result Fields)

    CURRENTDAT    CHAR(CURRENT(DATE),ISO)  Gets todays date in a YYYY-MM-DD format.

    OLDESTDATE  CHAR(DATE(CURRENT(DATE) - 70 DAYS), ISO)  Gets a date 70 days ago./

    630 pointsBadges:
    report

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.

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

Following

Share this item with your network: