How do I modify the value returned from current(time)

10 pts.
Tags:
AS/400 Query
AS/400 TimeStamp
I have an AS/400 query that requires me to search records with a timestamp from 20 mins prior to the current system time. If I use the current(time) value in the query, how do I modify it to return a time 20 minutes earlier?

Answer Wiki

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

I think you can substring the minute part of the timestamp ie MM in HHMMSS and minus 20 from it then build the timestamp again.You may have to change the MM part to *dec from *char.

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
  • Yorkshireman
    Qry now understands data types for date, time and timestamps, so you can extract the parts of the timestamp, create a result which is 'MINUTES(field) -20' and then recreate the timestamp data type to enable a 'Less than' compare. If you use the F1=help key in the select records panel all is made (almost) clear. You will have to be aware that a simple arithmetic subtract of 20 from, say a field value of 15 minutes will give -5. Reconstituting a timesatmp with invalid data isn't allowed. Alternatively, convert the query to query manager, then use SQL. STRQM, and follow the command keys will soon get you there if you're not familiar with it.
    5,580 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