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

converting char to int question

100+
P: 219
I have a field which is a char type, but generally will contain numbers. I want to convert this to an int datatype so that I can perform mathematical expressions on it. The problem I'm running into is that sometimes people are entering non-numerical data into this field. Is there a way that I can strip off the non-numerical data so I only have the numbers?
May 16 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
Yes.

But you may want to consider if the value on the columns is accurate in the first place. You might have to parse the value of the column.

You may use these functions:

ISNUMERIC()

http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx

-- CK
May 16 '08 #2

Post your reply

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