× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



IIRC,

ODUDATCYMD LT :INPUTDATE

Character field must be in double quotes.

Do not know the PARM on the command to pass the parm into the query. (Otherwise revamp as a QM Query).

Regards,
Carel Teijgeler


Op 30-6-2016 om 17:29 schreef Steinmetz, Paul:
Below is my query select.

ODUDATCYMD LT '1160130'

DSPOBJD to an output file results with ODUDAT Last used date (MMDDYY)
To compare an object's last use date, the ODUDAT needs to be reformatted with the century added.
ODUDATCYMD is a result field from century year month day.

ODUDATCYMD ODUCEN || ODUDATY || ODUDATM || ODUDATD Last Used Date (CYYMMDD)

I would like to replace the hardcoded literal '1160130' with a variable.

Paul


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Darren Strong
Sent: Thursday, June 30, 2016 11:06 AM
To: Midrange Systems Technical Discussion
Subject: Re: AS/400 query with date - 6 months

I'm assuming you're wanting to do some date arithmetic on today's date? If so, I learned the following from the F1 screen in the Define a column section of WRKQRY.

char(current(date)- 6 months,iso)

Looks like it works, except that the value isn't numeric, and I couldn't find a way to make it so.



From: "Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 06/30/2016 10:19 AM
Subject: AS/400 query with date - 6 months
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I have an AS/400 query with a hardcoded date.
The date is today's date - 6 months.
Example 1160130.

I'd like to make this date a variable.

Can this be done within the query?
Or
Must it be done outside the query and pass the date as a variable to the query?
Then, instead of calling RUNQRY, I would need to STRQMQRY.

Any thoughts from the group?

Thank You
_____
Paul Steinmetz
IBM i Systems Administrator

Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071

610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home

psteinmetz@xxxxxxxxxx
http://www.pencor.com/

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.