Reported By: Jose Eduardo Helminsky Reported On: 6/7/2001 For: Version 2.10 Build 1
# 807Using a NULL Value in SQL IF() Function Call Causes Error The following SQL results in an error. The second result is OK but with 0 into the column when the first letter
in the field tip is not a letter "E". What I want is null value instead of the number 0.
1) select pro, if( substring(tip from 1 for 1)="E" then cast(qtd as
float)
else null) as "Entry"
from products <----------- ERROR
2) select pro, if( substring(tip from 1 for 1)="E" then cast(qtd as
float)
else 0.0) as "Entry"
from products <------------ NO ERROR
ResolutionFixed Problem on 6/15/2001 in version 2.11 build 1