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

Access Update Query not working

Status
Not open for further replies.

elgeejay

Technical User
Apr 29, 2005
6
US
Trying to use update query to change all occurrences of telephone exchange (NOT Area Code) in field Phone1 from 978 to 571 (e.g., (405)978-3345 to (405)571-3345). Data is stored as xxxxxxxxxx.

To select records I'm using:
mid([Phone1],4,3)="978" -- this works fine.

For "Update to" I'm using: left([Phone1],3) + mid([Phone1],4,3)="571" + right([Phone1],4).

This action not only doesn't update the records as I want it to, it deletes all the phone number data.

Hope someone can assist. Thanks.
 
You're concatenating, not adding. Replace the "+" operator with the "&" operator.

HTH...

Ken S.
 
Left([Phone1],3) & "571" & Right([Phone1],4)

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

Part and Inventory Search

Sponsor

Back
Top