Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null values

Status
Not open for further replies.

ecsrs

Technical User
Apr 22, 2002
35
0
0
US
I'm having a problem with returning records with null values. I have a field called street type, which is null about 15% of the time. I wrote the following formula(streettype) to check for Null Values and assign them a default value.

if Isnull ({ta_cla.street_type})
then {ta_cla.street_type} = 0

I then placed this formula in a formula called address. I use the Evaluateafter(streettype) function and I still cannot get the Null values to default to "0".

Am I doing something wrong???
 
I got around this by writing a view. Use the following syntax to convert NULL values on the server:
Code:
"SELECT KeyField, ISNULL(Quant,0) FROM Table1"

This will return a result of 0 in the recordset if the field value is NULL (remember to use a string if field is not a numeric datatype).

NULL in CR gives me fits, so I use this as a workaround.
 
The problem with your original approach is that
if street_type is indeed Null, the THEN portion of your expression returns the result of comparing (NOT assigning as you may have thought it would) street_type to zero (rather than simply returning zero).

Comparing a Null to zero results in a Null...

Follow Malcolm's suggestion above and all should
be well.

hth,
- Ido ixm7@psu.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top