Solved

Iif Isnull problem

Posted on 2009-04-05
5
857 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
5 Comments
 
LVL 11

Accepted Solution

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

Assisted Solution

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now