AS/400 Query: Current Date

150 pts.
Tags:
AS/400 command keys
AS/400 CURRENT
AS/400 Query
Is there a quick way of running a query to select records based on current sysdate. I know you can get current date using Current command but I can't use it in selection.
ASKED: June 16, 2008  3:42 PM
UPDATED: September 5, 2013  4:39 PM

Answer Wiki

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

Hi Try the following :-

In “Define result fields” :-

Field Expression
CD CHAR(CURRENT(DATE))
CURDAT SUBSTR(CD, 1, 2) ||
SUBSTR(CD, 4, 2) ||
SUBSTR(CD, 7, 2)

Then use CURDAT in your selection. You may have to change the day/month/year sequence to match your date field.

Regards,

Martin Gilbert.

Thanks a million – this worked a dream. G

Discuss This Question: 1  Reply

 
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
  • NoelW
    IF your transaction files have date in the format YYYYMMDD then you can use: (YEAR(CURRENT(DATE)))*10000 + (MONTH(CURRENT(DATE)))*100 + (DAY(CURRENT(DATE)))
    10 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.

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