Solved

# Iif Isnull problem

Posted on 2009-04-05
857 Views
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")
``````
0
Question by:Touy

LVL 11

Accepted Solution

Quetzal earned 32 total points
Try =Iif(Nz([City],"")="","30","50")
0

LVL 41

Assisted Solution

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

Jeffrey Coachman earned 31 total points
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

Try =IIf(len(Nz([City]))<2,30,50)
0

## Featured Post

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…