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



Put the format of the dates like Joe sent you '1960-01-01'. Or I usually just use '1960101'. Those always convert properly without relying on format settings.

Scott Mildenberger | Software Developer | Washington Companies IT Services | 101 International Drive | Missoula, MT | Office: 406-523-1536 | www.washingtoncompanies.com

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of techie21 IT
Sent: Friday, July 17, 2020 3:39 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: filtering records between 2 dates

still same error i already put single quotes like select * from p2 where ORDDAT BETWEEN '01/01/1970' AND '31/12/1990'
select * from p2 where DOB BETWEEN '1960/01/01' and '2000/12/31'

error:-select * from p2 where DOB BETWEEN '1970/01/01' and '1990/12/31'
[image: image.png]

On Sat, Jul 18, 2020 at 2:56 AM Bruce Vining <bruce.vining@xxxxxxxxx> wrote:

If nothing else, please notice the use of quotes in Joe's example.

On Fri, Jul 17, 2020 at 5:22 PM techie21 IT <techiei876@xxxxxxxxx> wrote:

even though i have specified it as data type 'L' and with DATFMT
keyword
(*ISO) still i am getting this error.

On Sat, Jul 18, 2020 at 2:39 AM Joe Pluta
<joepluta@xxxxxxxxxxxxxxxxx>
wrote:

I always try to use ISO dates:

where ORDDAT between '1960-01-01' and '2000-12-31'


On 7/17/2020 4:06 PM, techie21 IT wrote:
my sql statement is like below:-

SELECT * FROM p2
WHERE ORDDAT BETWEEN 01/01/1960 AND 31/12/2000

Comparison operator BETWEEN operands not compatible.

File P2 is having ORDDAT field as a date field and is defined
using
'L'
data type.

So I want to filter records between some specific date range but
unable
to
do so because of the mentioned error.
So need guidance how could i remove this error to get desired
results?


Thanks much..


On Sat, Jul 18, 2020 at 1:52 AM techie21 IT
<techiei876@xxxxxxxxx>
wrote:

experts any updates please?

On Sat, Jul 18, 2020 at 12:53 AM techie21 IT
<techiei876@xxxxxxxxx>
wrote:

hi,

when trying to filter records between 2 dates getting this error:-
Message ID . . . . . . : SQL0401 Severity . . . . . . . :
30

Message type . . . . . : Diagnostic



Message . . . . : Comparison operator BETWEEN operands not
compatible.

Cause . . . . . : The operands of comparison operator BETWEEN are
not

compatible.

-- Numeric operands are compatible with any other numeric
operands
and
with character and graphic operands.

-- Character operands are compatible with operands that
are character,
graphic, date, time, timestamp, or numeric.

-- Date, time, and timestamp operands are compatible with
character
and
graphic operands or with another operand of the same type.
Date
and

timestamp operands are also compatible.

-- Graphic operands are compatible with graphic,
character,
date,
time,
timestamp, or numeric operands.

-- Binary operands are compatible only with binary operands.


More...
Press Enter to continue.



F3=Exit F6=Print F9=Display message details



--
This is the RPG programming on IBM i (RPG400-L) mailing list To
post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post
a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com



--
Thanks and Regards,
Bruce
931-505-1915
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

This email has been scanned by Washington Corporations using Message Labs Spam Filtering Technology. If this e-mail is SPAM that you no longer want to receive, please refer to the Spam or Junk Email Handling Process (https://washcorp.service-now.com/kb_view.do?sysparm_article=KB0011399). If you are experiencing any other e-mail problems, please call the IT Service Center at 855-WC-IT-NOW or x1212 from any office phone.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.