Converting a null value to a predetermined text value

J

Jimball

I have a query where some results may be null. In this case, is it possible
to set a criteria to allow the query to return a result for a null value to
equal some text value?

For example: If null then = "Unreviewed"

Thanks
Jim
 
D

Dale Fye

Jim,

Yes. The NZ( ) function will convert a NULL value to some predetermined (or
dynamically determined value.

SELECT Field1, Field2, NZ(Field3, "Default Value") as Field3a
FROM yourTable

HTH
Dale
 
J

Jerry Whittle

Something like this in a query should work.

ReviewStatus: NZ([TheField],"Unreviewed")
 
K

Kristibaer

Jimball:

Had a similar issue a few days ago and Conan (MS) and I had a discussion
going back and forth. Please see 2/21 "populating null value" from
Kristibaer. There are a few ideas there that all worked but I actually came
up with one that even the pro said "well that shouldn't work, but if it does
and it isn't broke, don't fix it".

Good luck.
 
Top