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 |
|
Ambikaa
Starting Member
43 Posts |
Posted - 2008-08-06 : 08:35:35
|
| Hi All,how to convert varchar to int while checking the condition? i have a table in that prty_price column is varchar datatypeif i below query , the result that i am getting wrongSELECT prty_id, prty_genid,StateId,City,prty_Type,prty_SqrFootage,Prty_NoOfBedRooms,prty_NoOfBathRooms,prty_Price,prty_status FavStatus FROM tbl_Property WHERE (prty_Price >= '10000' AND prty_Price <= '60000') AND prty_Deleted=0could u suggest me to convert the varchar to int in the condition? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-06 : 08:37:35
|
| SELECT prty_id, prty_genid,StateId,City,prty_Type,prty_SqrFootage,Prty_NoOfBedRooms,prty_NoOfBathRooms,prty_Price,prty_status FavStatus FROM tbl_Property WHERE (cast(prty_Price as int) >= 10000 AND cast(prty_Price as int) <= 60000) AND prty_Deleted=0MadhivananFailing to plan is Planning to fail |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-08-06 : 08:37:40
|
| where cast(prty_price as int) between 10000 and 60000Em |
 |
|
|
|
|
|
|
|