At 12:45 PM 7/18/2014, Hodges, Dennis wrote:

I have a column in my table that contains the Beginning Equipment
Usage (begeqp).  In my Edit form I want to set the begeqp to the
high usage value (eqphigh) of the eqphigh table, otherwise I want
to use the current value of begeqp. I tried using IFNULL as shown
below:

(ifnull(begeqp,eqphigh in eqphigh where dotnum eq dotno,begeqp))
And got the following error.

The first and last arguments for IFNULL must be the same type. (2155)

They are not only the same type, they are the same variable.

How can I do this?


Correct Syntax:

Previous topic
(IFNULL(arg1,arg2,arg3))

Arguments cannot be a SELECT or SUB-SELECT statements.

So, first create all arguments and then compare 'em accordingly.

Here's a very simple test to understand the proper logic of using
IFNULL function in R:BASE.

SET VAR v1 INTEGER = 100
SET VAR v2 INTEGER = 200
SET VAR v3 INTEGER = 300
SET VAR v4 INTEGER = NULL
SET VAR v4 = (IFNULL(.v1,.v2,.v3))

The value for v4 should be 300.

The same logic applies when comparing Column/Variables having the
same data type.

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase
--
31 years of continuous innovation!
16 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--


Reply via email to