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 |
|
rameshgoudd
Starting Member
13 Posts |
Posted - 2008-03-17 : 01:46:50
|
| hii have a three fields in my table..those areFromPercentage -Varchar(30)ToPercentage -Varchar(30)Scale -Int(11)i have the percenatge that 10%...now i want to check that whether this 10 % is in between the frompercentage and topercentage..if it is there i want to return the the scale value..how can i do this in sql.i know comparing when it is integer using where and and operator..but i dont know how use if it has the percentages.Ram |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-17 : 05:33:40
|
| You should have used int datatype to store percentage valuesTrySelect scale from your_tablewhere cast(replace(@your_input,',','') as int) between cast(replace(FromPercentage ,',','') as int) and cast(replace(toPercentage,',','') as int)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|