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)
 probel in query values

Author  Topic 

maifs
Yak Posting Veteran

57 Posts

Posted - 2009-03-14 : 13:15:58
i want to get BedRoom between the given price ranges.

i mean to say user first enter the city then location then choose price ranges then choose area ranges.

when i choose these then It should be displayed BedRoom of that selected items.

i am trying this for this purpose but the result is not returning accurate.



ALTER PROCEDURE dbo.BedRommHomes
@city varchar (50),

@loc varchar (200),
@price1 bigint,

@price2 bigint,
@area1 varchar (50),

@area2 varchar (50)

AS

BEGIN



SELECT DISTINCT BedRoom

FROM tblPropertyDetail

WHERE

(City = @city)AND(PropertyLocation = @loc)

AND

(Price >= @price1) AND (Price<= @price2)

AND

Area IN(@area1,@area2)


END




sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-03-14 : 13:21:19
Learn to use array in @Area:

http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
Go to Top of Page
   

- Advertisement -