AS/400 Query – Current date -1

5 pts.
Tags:
AS/400 date format
AS/400 queries
AS/400 Query
Is there a quick and easy way to calculate yesterdays date by using "Define result fields"
ASKED: April 1, 2009  8:35 AM
UPDATED: May 27, 2011  12:36 AM

Answer Wiki

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

Hi,

This should do the trick – define a result field as :-

CURRENT(DATE) – 1 DAYS

Regards,

Martin Gilbert.

Hi Martin,

I need some brief example (coding) for the CURRENT(DATE).

Regards
SS

Hi,

Here’s a copy from the screen :-

<pre>
Field Expression Column Heading Len Dec
YESTERDAY CURRENT(DATE) – 1 DAYS
</pre>

Can’t make it any simpler than this.

Regards,

Martin Gilbert.

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.

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
  • Moonlighter
    How can I get just the month and year from the current date using 'Define Result Fields'?
    10 pointsBadges:
    report
  • TomLiotta
    How can I get just the month and year from the current date using ‘Define Result Fields’? The Query for i5/OS PDF has numerous date examples and describes all of the functions. For your case, you might use CHAR(CURRENT(DATE)) to get a character representation of the date. Then use SUBSTR() to get month and year substrings. Or instead you might just use YEAR(CURRENT(DATE)) to get the year and MONTH(CURRENT(MONTH)) to get the month. Regardless, you should get and review the product documentation before using the product. Tom
    125,585 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