Link to home
Start Free TrialLog in
Avatar of Amour22015
Amour22015

asked on

MS Access - Query syntax to look up condition

Hi Experts,

I have a field for company name:

The Great Company
The Microsoft Company
The Book Store

I need to write a simple query in Access like:

CompanyName: Iif(Left,3 = The) then
put at end the word The

So it would be like:
Great Company, The
Microsoft Company, The
Book Store, The

Thanks for any help
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Avatar of Amour22015
Amour22015

ASKER

It looks like I don't understand and am knew to all this.

I have a field:
CompanyName

In that field I could have some Company names that start with "The" it could also have " The" (with a blank in front of the word "The".
So:
The Great Company
 The Microsoft Company
The Book Store

I am using MS Access 2010
I am doing this in a simple query:
CompanyName: Iif(Left((CompanyName),3)="The" then (Left((CompanyName),-4) & ", The")

I am looking for something like above.  Seems the link pointed out above is too complex for what I am looking for?

Thanks for any help
Avatar of Rey Obrero (Capricorn1)
use this

CompanyName:iif(Left([companyfield],3)="The",[companyfield] & ", The",[companyfield])
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks that looks like it