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 |
|
sqlchiq
Posting Yak Master
133 Posts |
Posted - 2008-10-20 : 13:05:06
|
| I have columns in the following format119.00(USD)19.00(USD)119.65(USD)etcI need just the number value. 11919119etcI know this is an easy one, but I cant get it to work for some reason... |
|
|
sqlchiq
Posting Yak Master
133 Posts |
Posted - 2008-10-20 : 13:11:50
|
| its not working for me because CHARINDEX(column, '.')is returning all 0s for me |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-10-20 : 13:12:10
|
| select left(col1,charindex('.',col1)-1) |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-10-20 : 13:12:53
|
quote: Originally posted by sqlchiq its not working for me because CHARINDEX(column, '.')is returning all 0s for me
CHARINDEX('.', column) you had it the other way around :) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-20 : 13:14:46
|
| AlsoSELECT CAST(REPLACE(col,'(USD)','') AS int) |
 |
|
|
|
|
|