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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to give different replace function within the

Author  Topic 

Ambikaa
Starting Member

43 Posts

Posted - 2008-08-06 : 09:02:40
Hi,

thanks!
it works but, in my prty_Price column contains the value like

prty_price
10000
12,000
$ 45999
56.345


how to give different replace function within the query?

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(replace(prty_Price,'$','') as int) >= 10000
AND cast(replace(prty_Price,'$','') as int) <= 60000) AND prty_Deleted=0


for $ , comma , .

thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-06 : 09:04:22
cast(replace(replace(prty_Price,'$',''),',','') as int

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -