expression for calculated field (1 Viewer)

nonrev1

Registered User.
Local time
Yesterday, 22:30
Joined
Jul 12, 2002
Messages
15
I have a table with several thousand accounts. They include some national accounts that have many branches. Each national account has an account number called [Natl Home]. Each branch has a separate branch account number called [branch]. Each record also has [Account Name] but it is the name of the individual branch only and they vary greatly.

I would like to create a query and add a calculated field entitled [Natl Name] and write an expression that says

If [Natl Home] is "123456" display "XYZ Company", If not "123456" display [Account Name]

This way I will get one field with the [Account Name] of any accounts that are not national and the headquarters name of any account that is national.

I'm a beginner and have tried several combinations based on some previous expressions but keep getting errors. TIA for any help!
 

jfgambit

Kinetic Card Dealer
Local time
Today, 03:30
Joined
Jul 18, 2002
Messages
798
In a new field of your query type the following:

NatAcct: iif([Fieldx] = "CRITERIA",[ComapnyField],[AcctField])

Try that...
 

nonrev1

Registered User.
Local time
Yesterday, 22:30
Joined
Jul 12, 2002
Messages
15
Thanks so much! That did it. I was on the right track... just to many () and not enough ""
 

Users who are viewing this thread

Top Bottom