Hi  Larry,

 

My suggestion would be to avoid the null  value by setting the default value
to 0 . I assume the lowprice never will be really 0.00 (for free),

Then you can avoid the complicated if-statement

 

Tony

 

From: [email protected] [mailto:[email protected]] On Behalf Of Lawrence
Lustig
Sent: donderdag 23 juni 2011 23:05
To: RBASE-L Mailing List
Subject: [RBASE-L] - Issue with IFNULL and SET ZERO.

 

I have a table with two currency columns LOWPRICE and REGULARPRICE.
REGULARPRICE always has a value in it.  LOWPRICE sometimes has a value in
it.

 

I need to derive a third value (preferably in a computed column) according
the following rule:

 

If LOWPRICE is NULL, use REGULARRICE.

IF LOWPRICE is NOT NULL, use the lower of LOWPRICE and REGULARPRICE, even if
LOWPRICE is $0.00.

 

I can do this with the expression (IFNULL(LOWPRICE, REGULARPRICE,
LMIN(LOWPRICE, REGULARPRICE)).  That works fine -- but only if SET ZERO OFF
is applied.  If SET ZERO ON is applied, R:Base loses the ability to
distinguish between the values $0.00 and NULL in LOWPRICE.

 

I'm looking for a trick that will be able to distinguish NULL and $0.00 with
ZERO set ON.

 

Anyone have any ideas?

--

Larry

Reply via email to