Use Replace in Access SQL only when the first two characters of the string match my pattern -


i'm working database names apostophes in them (e.g. irish or scottish style names such o’doherty) stored space instead of apostophe (e.g. "o doherty").

in query, want return names in correct format (just in select query, rather changing data), i've used:

 replace([snametemp],"o ","o’") 

this works in theory, problem i'm having there matches pattern further along string: e.g., "do not use" returned "do’ not use".

how write replace statement checked first 2 characters of string?

should in access

iif(snametemp "o *", replace([snametemp],"o ","o’"), snametemp) 

Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

java - gson parse items from comma-separated-value string within a json value -

Validation in java Error log in register -