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 |
|
bricktop
Starting Member
2 Posts |
Posted - 2005-05-25 : 15:08:35
|
| I need to exclude all of my FileNbr WHERE the right most character is an alpha character and can vary.Example:FileNbr12341235123A123SResults expected12341235This is what I have so far:SELECT * FROM TEMPWHERE (RIGHT(FileNbr,1)<> ?? |
|
|
twhelan1
Yak Posting Veteran
71 Posts |
Posted - 2005-05-25 : 15:18:41
|
| Use the ISNUMERIC function to determine if the last character is not numeric. Ex:SELECT * FROM TEMP WHERE ISNUMERIC(RIGHT(FileNbr,1)) = 1 |
 |
|
|
bricktop
Starting Member
2 Posts |
Posted - 2005-05-25 : 16:33:26
|
| Thanks it works great. so if I wanted to keep only the records that had an alpha I would change the =1 to ? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-05-25 : 16:41:45
|
| 0Brett8-) |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-05-26 : 09:32:03
|
bear in mind that isnumeric also returns true for this:1234e5Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-05-26 : 10:02:20
|
| if you have data as spirit1 specified, then you need to use this to exclude that dataSELECT * FROM YOURTABLE WHERE ISNUMERIC(FileNbr) = 1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|