# ASP - Query Help - 3 into 1

**URL:** <https://forum.kirupa.com/t/asp-query-help-3-into-1/180091>\
**Category:** Uncategorized\
**Created:** [February 25, 2006, 1:55pm UTC](https://forum.kirupa.com/t/asp-query-help-3-into-1/180091 "2006-02-25T13:55:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![burns](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@burns](https://forum.kirupa.com/u/burns)\
**Post date:** [February 25, 2006, 1:55pm UTC](https://forum.kirupa.com/t/asp-query-help-3-into-1/180091/1 "2006-02-25T13:55:52Z")

</div>

Is it possible to combine these 3 queries into 1:

'/////////////////////////////////////////////####################  
If Status = “Sale” Then  
sSQL = "SELECT \* FROM tblProperty WHERE Status = ‘Sale’ AND (Beds \>= " & beds & ") AND (price \>= " & minprice & " AND price \<= " & maxprice & “) “& QueryType &” “& QueryArea &” ORDER BY price ASC”

ElseIf Status = “Resale” Then  
sSQL = "SELECT \* FROM tblProperty WHERE Status = ‘Resale’ AND (Beds \>= " & beds & ") AND (price \>= " & minprice & " AND price \<= " & maxprice & “) “& QueryType &” “& QueryArea &” ORDER BY price ASC”

Elseif Status = “both” Then  
sSQL = "SELECT \* FROM tblProperty WHERE (Beds \>= " & beds & ") AND (price \>= " & minprice & " AND price \<= " & maxprice & “) “& QueryType &” “& QueryArea &” ORDER BY price ASC”

else  
response.write “go back”  
End If  
'//////////////////////////////////

status value is coming from a form

Many Thanks
