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!

IIf Function with multiple Conditions

Status
Not open for further replies.

ice051505

Technical User
Feb 18, 2013
12
0
0
CA
Hi all, I have a query with 5 field, [Country],[Province],[GroupingInfo],[City],[Area]
I want to write or build a new query to have something on the [City] critiria like:

IIf [City]="NoInfo" And [GroupingInfo]<=1 Then [City]=[Province], else [City] = [City]

This is on the Query Sql, not on the VBA Code

Thanks So Much!
 
Code:
CITY = CASE WHEN  [City]="NoInfo" And [GroupingInfo]<=1 Then [Province] else [City] END

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top