?
Solved

Iif Isnull problem

Posted on 2009-04-05
5
Medium Priority
?
866 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 128 total points
ID: 24073363
Try =Iif(Nz([City],"")="","30","50")
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 124 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 124 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 124 total points
ID: 24076173
Try =IIf(len(Nz([City]))<2,30,50)
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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