IIF (Looking for a null)

BukHix

Registered User.
Local time
Today, 06:35
Joined
Feb 21, 2002
Messages
379
I have a query where I need to check for a null in a numeric field. I did a search on this forum and found several threads with the answer. However, for some reason I can't get it to work. What am I doing wrong here?

Vendx: IIf( isnull ([Vendor],999,[Vendor])

All I need to do is put a 999 in any Vendor field that is empty otherwise use the assigned number.
 
Vendx: IIf(IsNull([Vendor]),999,[Vendor])

You'd be better with:

Vendx: Nz([Vendor],999)

as it has less evaluation (i.e. faster)
 
Thank you Mile-O-Phile. You get two points for this one because you actually helped me solve a bigger problem I was having with getting what I wanted out of SQL Server's Enterprise Manager for some Crystal Reports I am working on.

THANKS AGAIN!!!!!!
 
Excellent. Especially since I've never seen SQL Server or Crystal Reports. :cool:
 
Darn. I thought that maybe since you helped me with that one you could possible tell me how to run a DTS package from a VB.Net form but since you have never used SQL Server you are probably not going to be able to answer that one. :D

Anyway thanks again for the above help. I have been stuck at that point since late yesterday.
 

Users who are viewing this thread

Back
Top Bottom