Dennis,
SELECT (SLEN(fieldname)) = 0 will detect the difference between
zero and null
with SET ZERO OFF.
Interestingly, CTXT is required to convert an integer to text in
order for SLEN to work.
(CTXT(fieldName)) converts both 0 and -0- (NULL) to 0.
If (CTXT(fieldName)) converted 0 to '0' and -0- to '-0-' or NULL or
' ', you could differentiate between them.
It may be important with set ZERO ON to have NULL operate as if it
is a zero. However that may not be as critical when converting a NULL to a
character or text value.
Randy Peterson
Dennis McGrath wrote:
> Razzak,
>
> > What Build of R:BASE 6.5++ you or your client is using?
>
> Client is using 6.5++ 1.866 RT03
>
> >
> > I got the following results using your example below:
> >
> > -0- is null
> > -0- not gt 0
> > -0- eq 0
> > -0- not lt 0
> > -0- not exists
> > -0- x 0. x
> >
> > 0. is null
> > 0. not gt 0
> > 0. eq 0
> > 0. not lt 0
> > 0. not exists
> > 0. x 0. x
> >
>
> As you can see, NONE of the examples can differntiate between a null
> and zero. The results are identical! One would logically think that
> IFNULL would be up to the task, but it is not.
>