Access Update Query not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

First-time poster... sorry if this is simplistic.

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.
 
elgeejay said:
First-time poster... sorry if this is simplistic.

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 don't need the Mid(). Just use...

left([Phone1],3) + "571" + right([Phone1],4)
 
Portion of message should have read as follows:

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).
 
Back
Top