By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,510 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,510 IT Pros & Developers. It's quick & easy.

Stripping 0's from numbers and letters from alphanumeric data

P: 1
Hello forum.

I need to learn how write a SQL script to strip 0s from data and strip alpha letters from alpha numeric data.


I get data like 054, 006, 903, for a dept number. I need to strip the leading zeros from right. and keep the rest of the numbers. Whats the best way to script this striping?


IF you get alpha/numeric numbers like 5FD78, 000FG98, 00098FG dont want the alpha numbers or leading zeros

Appreciate any help.

Oct 6 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 5,821
Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).
Oct 6 '07 #2

P: 46
I dont know if this is possible in SQL ... but, one way could be to use a scripting language like perl to handle the database queries and then parse the results however you want with it's regular expression handler.
Oct 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.