IIF like question

A

arran1180

I'm trying to add a field to a query that will input a text code depending on
a range in another field -

I have a field of acount names and all the ones that begin with 74 or 71 i
want another field to label these as "swng", and all others as "cpty".

I am trying an IIF function: IIF ([account]= like "74*" or
"71*","swng","cpty") - but its not working

I have 100's of accounts, so i really need to get this like func working!
any help really appreciated
 
D

Dennis

If account is always at least 2 characters long then try this

IIF (Left([account],2)= "71" Or Left([account],2)="74","swng","cpty")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top