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



Jon

I need to build a date range from a numeric field. I then use the dates in a
SELECT search that uses BETWEEN dates.

It was a debug operation because I could not see why I was getting the
select results I got.

Darryl Freinkel
A4G
Telephone: 770.321.8562 Mobile: 678.355.8562

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jon Paris
Sent: Tuesday, July 13, 2021 4:18 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Convert a date field to a 10,0 packed field

I don't understand why you are even using SQL if this really is your code.

You stated that wSched_Date is a date field (assumedly ISO).

So to convert it to numeric you simply code:

wCur_Date_To = %Dec(wSched_Date);

That assumes that the numeric version is to be the same format as the
original - if that is NOT what you want then specify the format as the
second parm.

eg, wCur_Date_To = %Dec(wSched_Date : *USA ); // _Target_ format is *USA




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.