Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 Query Assistance

Status
Not open for further replies.

warpdrve

IS-IT--Management
May 28, 2002
47
US
Hi All,

I hope someone can help me with this problem. I need to develop a query where I want to compare file information to the current date. However, I want minimal user interaction since I won't be using this query. The AS/400 maintains a system value QDATE which is the current system date. Unfortunately, I can't figure out anyway to use this value in a query using the query system.

I am not an RPG (or any other) programmer and was hoping there'd be a simple solution to this. I am even willing to use a command language routine to write the current system date to a separate file and then link that file to my query (which would work) ... but not really sure how to create a CL routine to do this either.

If anyone can offer some assistance, it would be greatly appreciated.

Regards - M
 
It depends - is the date in the file a numeric field, or a "native" date?

If it's a native date, you can compare it to CURRENT(DATE) in Query. If the date is numeric, you need to convert it to a date data type on the Define Result Fields screen.

See:


Good luck.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci
 
Thanks for the reply - I managed to figure it out --- it was the CURRENT(DATE) that I specifically needed ... once I figured that out, it was easy to convert it to a date format for the comparison.

Regards - M
 
M -
You're welcome.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top