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

Try this again, query. 1

Status
Not open for further replies.

Skins64

Technical User
Oct 11, 2005
32
US
I have a field called "Dear" which contains "Mr Smith" "Ms. Jones" etc....This field also contains preferred names like Bob or Ted or Buck.

I need to update a field called "Preferred Name" with contacts who have a Bob or Buck etc in the "Dear" field.

Do not want to update preferred name with names that begin with Mr. or Ms.

Hopes this makes sense.


I guess I need to write a string that says...when "Dear" DOES NOT contain Mr. Mrs. Ms. Dr. etc update "Preferred Name" field.

[Preferred Name] = Dear
Where Left([Dear],3) NOT IN ('Mr.', 'Mr ', 'Mrs', 'Ms ', 'Dr.')

The above does not work in my query, any suggstions?

Thanks!
 
In the SQL view pane of the query window:
UPDATE yourTableNameHere
SET [Preferred Name] = [Dear]
WHERE Left([Dear],3) Not In ('Mr.','Mr ','Mrs','Ms ','Dr.')


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top