Replace nth character in a string

KellyOD

New member
Local time
Today, 23:05
Joined
May 25, 2018
Messages
2
Hi,
I have a field (legaldescription) that contains the characters \ and I am trying replace these with a /. An example of values in this field are

68\PS705469
2\PS710373

I'm using the query builder in Access to first identify the location of the special character and have written this value to a new field using this expression.

legalDescCntSC: InStr(1,[legaldescription],"")

In the two examples above I then have identified the special character is in position 3 and 2 (for the second example. What I'd now like to do is use this position to replace the \ with a /.

Like this:
68/PS705469
2/PS710373

Can someone assist?
 
You don't need to do all of that. Just use:

Code:
Replace([legaldescription],"\","/")

You can either populate a new field or use it in an update query to replace the existing data

P.S. Welcome to AWF
 
Fantastic! Thanks so much.
 

Users who are viewing this thread

Back
Top Bottom