Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-15 : 08:43:10
|
| Brian writes "I'm sorry my title isn't the most descriptive, but hopefully someone will be able to help me out.Okay, I have a table, tblAcctTrans, with, say, one field: AcctNum. Some of our older account numbers in AcctNum contain letters. Those are the ones we're trying to avoid. So, for example, I want my results to give these account numbers:123458234567but not any account number with a letter in it:123f45s345d6Any suggestions on what operator(s) to use and how to set it up in the query? Thanks,Brian" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-05-15 : 08:43:51
|
| SELECT * FROM tblAcctTrans WHERE AcctNum NOT LIKE '%[^0-9]%' |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-05-15 : 10:14:42
|
| SELECT * FROM tblAcctTransWHERE ISNUMERIC(AcctNum) = 1 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-15 : 11:25:32
|
quote: Originally posted by Peso SELECT * FROM tblAcctTransWHERE ISNUMERIC(AcctNum) = 1
ISNUMERIC is not reliable.Read thishttp://aspfaq.com/show.asp?id=2390MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|