Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF question

Status
Not open for further replies.

Zippeh

Programmer
Sep 24, 2002
56
GB
Hi,

I'm trying to run a query that will look at the value in two columns and put it into another column.

I have two columns, policy_number and map_number. If there is a policy number, then there isn't a map_number and vice_versa. I now have a third column called display_number. What I want is for display number to contain the value of either policy_number, or map_number depending on which one exists.

Here is what I have so far...

display_number: IIf([map_number]='',[policy_number],[map_number])

Any ideas? Thanks in advance :)
 
You could try the IsNull function:

[tt]display_number: IIf(IsNull([map_number]),[policy_number],[map_number])[/tt]

Roy-Vidar
 
Another way.
display_number: Nz([map_number],[policy_number])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top