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-22 : 11:33:12
|
| Hi ,i need a help. when i used this below query, i am getting wrong resultSee the output, it differs from the condition.SELECT prty_Price FROM tbl_Property WHERE cast(replace(replace(replace(prty_Price,'$',''),',',''),'.','') as int)>= '200000' AND (cast(replace(replace(replace(prty_Price,'$',''),',',''),'.','') as int)<= '400000') AND prty_Deleted=0outputprty_Price3456.7834,34672000002345443453453453453454.45 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-08-22 : 11:37:55
|
| Give an example of an input and an output and tell us what you expected the output to be. Also, you are casting the field to an int and then comparing it to a string.Jim |
 |
|
|
RSQLSERVER
Starting Member
5 Posts |
Posted - 2008-08-22 : 11:44:44
|
| From the code written, is this what you are planning to do?There is a prty_Price Column which has something like $32,455.60 and you want to render it as 3245560 . Is that right? |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-08-22 : 12:57:11
|
| The results are correct per your condition. Can you explain what you are trying to do, it's probably just a logic error. |
 |
|
|
|
|
|
|
|