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

Need to Replace the first character of a string 2

Status
Not open for further replies.

shelley6

Technical User
Sep 7, 2006
1
CA
I need to replace only the first character of a string using SQL Query. For instance:

Is:
3000378920 (or anything starting with a 3)

Should be:
2000378920

I'd appreciate any suggestions
 
UPDATE yourTable
SET yourString='2' & Mid([yourString], 2)
WHERE yourString Like '3*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
UPDATE YourTable SET YourTable.YourField = "2" & Mid([YourField], 2, Len([YourField]))
WHERE (((Left([YourField], "1")) = 3));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top