Here are a couple of suggestions.

First thing is that LMAX(list of dates) will give you the greatest date, not 
the oldest.

Regardless of what you are looking for, you need to determine what the most 
extreme date in your data is. Set a variable for that value and then substitute 
it in Buddy’s formula.

Except for numbers with ZERO ON, NULL values can’t be used in any calculations 
or logical test because R:Base doesn’t know what the value is. E.g. comparing 
‘text value’ to NULL always results in FALSE. Is ‘fred’ less than, greater than 
or equal to NULL?


Regards,

Stephen Markson
The Pharmacy Examining Board of Canada
416.979.2431 x251

From: 'Patti Jakusz' via RBASE-L [mailto:[email protected]]
Sent: February-14-17 6:37 PM
To: [email protected]
Subject: Re: [RBASE-L] - problem with null values

Thank you, Jan.

________________________________
From: jan johansen <[email protected]<mailto:[email protected]>>
To: [email protected]<mailto:[email protected]>
Sent: Tuesday, February 14, 2017 5:16 PM
Subject: RE: [RBASE-L] - problem with null values

Patti,

Buddy beat me to it but sometimes when we are using an older database, we 
actually saved a space for a null so you may need to check to see if you 
actually have nulls.

Jan

-----Original Message-----
From: "Buddy Walker" <[email protected]<mailto:[email protected]>>
To: <[email protected]<mailto:[email protected]>>
Date: Tue, 14 Feb 2017 17:11:14 -0500
Subject: RE: [RBASE-L] - problem with null values

Patti
   You might want to try something like this depending on how you want to hand 
null dates.
It my example I’m saying if date is null then make it 12/31/2999 or whatever 
date you want.

….  OldestDate = 
(LMAX((IFNULL(DATE1,12/31/2999,DATE1)),(IFNULL(DATE2,12/31/2999,DATE2)),(IFNULL(DATE3,12/31/2999,DATE3))))

I didn’t test this so make sure to test on a copy of database

Buddy


From: 'Patti Jakusz' via RBASE-L [mailto:[email protected]]
Sent: Tuesday, February 14, 2017 3:38 PM
To: [email protected]<mailto:[email protected]>; RBASE-L 
<[email protected]<mailto:[email protected]>>; RBASE-L 
<[email protected]<mailto:[email protected]>>
Subject: [RBASE-L] - problem with null values

Hello,

I'm using Rbase 10.  I'm trying to update one date column in my table to be the 
oldest of 3 other date columns.  My command is:

update Table1 set OldestDate = (LMAX(date1, date2, date3))

But it only works if all three dates have values.  I have zero set on.  I tried 
setting on Eqnull.  But I only get a blank if one of the dates is null.

Is there another setting to turn on?

Thanks,
Patti

--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to