Calculate date in future

Tags:
AS/400 command keys
AS/400 CURRENT
AS/400 Query
How can I ad an day to the current systemdate ? So that I only see the records of tomorrow (for example)?
ASKED: June 23, 2008  8:31 PM
UPDATED: June 24, 2008  8:48 AM

Answer Wiki

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

Hi,

You should be able to do this using the current(date) function in query :-

TD char(current(date) + 1 DAYS)
/* this will give you tomorrow’s date in date format (with separators) */

TOMDAT SUBSTR(YD, 1, 2) ||
SUBSTR(YD, 4, 2) ||
SUBSTR(YD, 7, 2)
/* Substring and concatenate the date value, without separators */

You may have to change the substrings, depending on your date formats.

Regards,

Martin Gilbert
(also in netherlands).

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