mATOK Posted August 16, 2006 Share Posted August 16, 2006 hey there, I have a column of type varchar that contains something that looks liek the followingCat 002Cat 002Cat 003Cat 005Cat 107etcWhat I would like to do is remove the 'Cat ' from every record and be left with only the three digit number.do I want to execute - UPDATE substring(category, 5, len(category)-4) ?I'm pretty new to these types of commands and would apreciate confirmation / correction.thanx Quote Link to comment Share on other sites More sharing options...
fenway Posted August 16, 2006 Share Posted August 16, 2006 If it's always 3 digits, you can do the following:UPDATE yourTable SET yourColumn = RIGHT( yourColumn, 3)But you'd probably want to run an equivalent select query first just to be sure. Quote Link to comment Share on other sites More sharing options...
mATOK Posted August 21, 2006 Author Share Posted August 21, 2006 Thank You! :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.