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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 Query, Define Result Fields, Subtracting Date 1

Status
Not open for further replies.

sueshe

MIS
Oct 24, 2007
6
0
0
US
I am mostly self taught using the AS400 Query, we are in version V05R03M00 IBM AS400. I am trying to build a query, and need to select records using Service Date(SRVDT) of eight days ago from today to yesterday. (will run on Thursday morning for last Thursday 12:00am to yesterday, Wednesday 11:59pm. I need to set this in Select Records so that the query can be run with no prompting for date changes. I am having a very hard time trying to figure out how to set up the result field for this calculation. I have been using
TODAY CURRENT(DATE)
TODAYISO CHAR(TODAY,ISO)
LASTWEEK DAYS(TODAYISO) - 8
and the result I am getting for the LASTWEEK field is:
73-29-65. Can someone help me, not sure what I'm doing wrong and can't find any documentation on this that will help me, or that I understand. Thanks in advance for your help!!!
 
Define LASTWEEK as CURRENT(DATE) - 8 DAYS. That will give you a native date.

Solum potestis prohibere ignes silvarum.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top