Well, you could convert the field from MDY to YMD using DIGITS and SUBSTR
and DECIMAL, something like:

DECIMAL(
SUBSTR(DIGITS(MYDATE),5,2) CONCAT
SUBSTR(DIGITS(MYDATE),1,4), 6, 0)

Once you have it in a usable format, you can just use the BETWEEN operator.
Of course, if you're dealing with pre-2000 dates you'll need to take into
account the century.

Joe



From: JDHorn@xxxxxxxxxxxxxx

I am attempting to select records in a file on a date stored as mdy in
a
6s 0 field.

could use the between option or as greater than one date and less than
another.

so far my solutions are far from elegant.

does anyone have an example of an rpg program to generate an sql select
statement to do this?

the date fields in the file may have zeros or other invalid dates in
them


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-2025 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.