Obviously, from your tests, the IFEQ is evaluating correctly.
It is the display that is odd.
Try playing with
SET ZERO
SET EQNULL
To see if they have any effect.
If all you are interested in is the display, not the datatype of the display,
then this should work:
select lsavg,(IFEQ(LSAVG, .VZERO, (' '),CTXT(LSAVG))) from color_line_study
where.....
If you need the display right justified you could use FORMAT instead of CTXT to
achieve this.
Dennis
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ramsour Mike
Sent: Wednesday, October 29, 2008 9:36 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - IFEQ question
Scenario:
SET VAR vzero DOUBLE = 0
SET VAR vnull DOUBLE = NULL
Column LSAVG data type DOUBLE
Simple logic test. If the value of LSAVG is 0 then display 'YES' otherwise
display 'NO'
select lsavg,(IFEQ(LSAVG,.VZERO,'YES','NO')) from color_line_study wher lsavg = 0
lsavg (IFEQ(LSAVG,.VZ
--------------- ---------------
0. YES
0. YES
0. YES
0. YES
0. YES
Then why does this not work?:
select lsavg,(IFEQ(LSAVG, .VZERO, .VNULL, LSAVG)) from color_line_study where
lsavg = 0
lsavg (IFEQ(LSAVG,.VZ
--------------- ---------------
0. 0.
0. 0.
0. 0.
0. 0.
0. 0.
The intent is to display NULL when the value of the lsavg field equals 0.
The reverse works OK:
select lsavg,(IFEQ(LSAVG,.VZERO,.VNULL,LSAVG)) from color_line_study wher lsavg
> 0 and limit = 4
lsavg (IFEQ(LSAVG,.VZ
--------------- ---------------
41.0823 41.0823
41.0799 41.0799
41.0823 41.0823
41.079 41.079
Thoughts anyone?
Mike Ramsour
AK Steel Coshocton Works
Quality Department
Phone/VMS: 740-829-4340