Solved

Iif Isnull problem

Posted on 2009-04-05
5
862 Views
Last Modified: 2013-11-28
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
Comment
Question by:Touy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 11

Accepted Solution

by:
Quetzal earned 32 total points
ID: 24073363
Try =Iif(Nz([City],"")="","30","50")
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 31 total points
ID: 24073409
That can only mean that City is not null. it could be a space. Try like this:
=IIf(Trim([City])="","30","50")  
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 31 total points
ID: 24074454
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
 
LVL 46

Assisted Solution

by:tbsgadi
tbsgadi earned 31 total points
ID: 24076173
Try =IIf(len(Nz([City]))<2,30,50)
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question