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



So you can't ask SQL if the expiration date is greater than today because if there is no expiration date the answer will be no. But you can ask SQL if the product is expired in which case if there is no expiration date the answer will be No.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Raul A Jager W <raul@xxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: Raul A Jager W <raul@xxxxxxxxxx>
Date: 09/22/2015 09:26AM
Subject: E-mail NO SCANNEABLE Re: Max date

In RPG you need to test, in SQL you can compare without testing for
null, just need to remember that null will not satisfy any condition
(except for: "is null")

In SQL, if I put null for "does not expire" those will not appear in a
select comparing which ones have expiration date greater than
'2015-09-30', *hival will appear. I do not need an extra test using nulls.


On 09/22/2015 08:53 AM, Charles Wilt wrote:
No it won't really...

Usually a null date in an newly inserted record end up with 0001-01-01, but
that is not guaranteed.

In either RPG or SQL, when dealing with nullable columns, you have to test
for null before trying to look at the value.

if not %nullind(mydate);
//date is valid
if mydate < = wrkdate;
//do something;
endif;
endif;

Charles

On Mon, Sep 21, 2015 at 6:41 PM, Raul A Jager W <raul@xxxxxxxxxx> wrote:

The exp_date is defined as date, but it is not nullable. Using null for
"does not expire" will require extra test, because RPG will bring it as
0001-01-01

On 09/21/2015 06:34 PM, Alan Campin wrote:
Is value a date data value and is it made nullable.

On Mon, Sep 21, 2015 at 3:22 PM, Raul A Jager W <raul@xxxxxxxxxx> wrote:

I need to store a date value for a "does not expire" document. I think
the easiest will be to insert 9999/12/31 which when compared with the
actual date will result Ok.
Is there a symbolic name for the maximum date? something like infinite
for numbers?

I will like to write something like:
exec sql insert into table(exp_date) values(?????)
where ????? will be replaced by an appropriate name.





-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --

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.