Replace command

C

CAM

Hello,

In my table I have over 125,000 policy numbers for example "A18954" what I
want to do is change just the letter "A" to "D" and keep the rest of the
policy number. For example policy number "A18954" should be now "D18954".
How do I do that in a query? Many thanks in advance.

Cheers
 
K

KARL DEWEY

First make a backup copy of your data (do it before every gobal change as
most can not be undone). Use an update query and in the design view grid for
the Updtate To row use Replace([YourFieldName], "A", "D") and run.
It will also replace an 'A' if it is elsewhere in the field like this --
A1234A to D1234D.
 
L

Lance

The replace function has a count option, which will allow you to decide how
many replacements to make. Make it 1.. and it will only replace the first
match.

KARL DEWEY said:
First make a backup copy of your data (do it before every gobal change as
most can not be undone). Use an update query and in the design view grid for
the Updtate To row use Replace([YourFieldName], "A", "D") and run.
It will also replace an 'A' if it is elsewhere in the field like this --
A1234A to D1234D.

--
KARL DEWEY
Build a little - Test a little


CAM said:
Hello,

In my table I have over 125,000 policy numbers for example "A18954" what I
want to do is change just the letter "A" to "D" and keep the rest of the
policy number. For example policy number "A18954" should be now "D18954".
How do I do that in a query? Many thanks in advance.

Cheers
 
Top