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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using an iff stament in my query 2

Status
Not open for further replies.

dwesnyc

Technical User
Nov 24, 2006
14
US
Hi,

I have a table that has one column with values like bob 1, bob 2, bob 3 etc.

I want to make a query and for anything that is bo* I want it to just display "bob"

I put iff([column]=bo*,"bob") but that did not work. What did I do wrong.
 
IIf([column] Like 'bo*','bob',[column])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That worked! But now I want to do another one in the same line, so for instance now I want to add that if its dav* show "david"

how do you combine multiple iif's
 
IIf([column] Like 'bo*','bob',IIf([column] Like 'dav*','david',[column]))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top