• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 876
  • Last Modified:

Iif Isnull problem

I've got a union query with the field [city]. Im tryping to let access return 30 when it is empty and 50 when it isn't, but for some reasons it all turns out to be 50. Am I missing sth?

Many thanks.
=IIf(IsNull([City]),"30","50")

Open in new window

0
Touy
Asked:
Touy
4 Solutions
 
QuetzalCommented:
Try =Iif(Nz([City],"")="","30","50")
0
 
ralmadaCommented:
That can only mean that City is not null. it could be a space. Try like this:
=IIf(Trim([City])="","30","50")  
0
 
Jeffrey CoachmanMIS LiasonCommented:
Touy,

Are these numbers "Strings" (text), or actual Numeric values?

Try this if they are numeric:
=IIF([City]="" OR IsNull([City]),30,50)

Also, can you state what this formula is the control source of?

JeffCoachman
0
 
tbsgadiCommented:
Try =IIf(len(Nz([City]))<2,30,50)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now