Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
I have a query based on a form. The query searches for apartments based on what they are looking for. They can put in area, price range, number of bedrooms, amenities etc. On the results page I have the apartment name displayed once along with other information. The part that I need help with is if the user puts in a price range, I would like only the number of bedrooms that would be in that price range show up. The number of bedrooms is the "Type field" and when they put in any floorplans (Type), The complexes are being repeated for each Type.
I'm including my statement. Any help would be greatly appreciated.
SELECT Apartment_Info.Apartment_ID, Apartment_Info.Apartment_Name,Apartment_Info.Area, MIN(Unit_Info.Low_Price) AS Starting_Price, Apartment_Info.YearBuilt, Apartment_Info.Bedrooms, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.Zip, Apartment_Info.State, Unit_Info.Type
FROM Apartment_Info INNER JOIN Unit_Info ON Apartment_Info.Apartment_ID = Unit_Info.Apartment_ID
WHERE Type LIKE 'varType' AND (Area LIKE 'varNorth' OR Area LIKE 'varNorthwest' OR Area LIKE 'varNorth_Central' OR Area LIKE 'varSouthwest' OR Area LIKE 'varCentral') AND Apartment_Name LIKE 'varName' AND Zip Like 'varZip' AND District LIKE 'varDistrict' AND Pools LIKE 'varPools' AND Washer_Dryer LIKE 'varWasher_Dryer' AND Access_Gates LIKE 'varAccess_Gates' AND Jacuzzi LIKE 'varJacuzzi' AND Microwave LIKE 'varMicrowave' AND Fireplace LIKE 'varFireplace' AND Pet LIKE 'varPet' AND Large_Pet LIKE 'varLarge_Pet' AND Fitness_Center LIKE 'varFitness_Center' AND Covered_Parking LIKE 'varCovered_Parking' AND Garage LIKE 'varGarage' AND Conn LIKE 'varConn' AND Prov LIKE 'varProv' AND Elementary_School LIKE 'varElem' AND Middle_School LIKE 'varMid' AND High_School LIKE 'varHigh' AND Basketball LIKE 'varBasketball' AND Alarms LIKE 'varAlarms' AND Water_Volleyball LIKE 'varW_Volleyball' AND Tennis LIKE 'varTennis' AND Vaulted_Ceilings LIKE 'varVaulted_Ceilings' AND Jogging_Trail LIKE 'varJogging_Trail' AND Sauna LIKE 'varSauna' AND Raquetball LIKE 'varRaquetball' AND Garden_Tub LIKE 'varGarden_Tub' AND Volleyball LIKE 'varVolleyball' AND Clubroom LIKE 'varClubroom' AND Business_Center LIKE 'varBusiness_Center' AND Attached_Garage LIKE 'varAttached_Garage' AND View LIKE 'varView' AND Laundry LIKE 'varLaundry' AND Patio_Balconet LIKE 'varPatio' AND Low_Price >=varLow_Price AND High_Price <= varHigh_Price GROUP BY Apartment_Info.Apartment_Name, Apartment_Info.Area, Apartment_Info.YearBuilt, Apartment_Info.Bedrooms, Apartment_Info.Apartment_ID, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.State, Apartment_Info.Zip, Unit_Info.Type
I have a query based on a form. The query searches for apartments based on what they are looking for. They can put in area, price range, number of bedrooms, amenities etc. On the results page I have the apartment name displayed once along with other information. The part that I need help with is if the user puts in a price range, I would like only the number of bedrooms that would be in that price range show up. The number of bedrooms is the "Type field" and when they put in any floorplans (Type), The complexes are being repeated for each Type.
I'm including my statement. Any help would be greatly appreciated.
SELECT Apartment_Info.Apartment_ID, Apartment_Info.Apartment_Name,Apartment_Info.Area, MIN(Unit_Info.Low_Price) AS Starting_Price, Apartment_Info.YearBuilt, Apartment_Info.Bedrooms, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.Zip, Apartment_Info.State, Unit_Info.Type
FROM Apartment_Info INNER JOIN Unit_Info ON Apartment_Info.Apartment_ID = Unit_Info.Apartment_ID
WHERE Type LIKE 'varType' AND (Area LIKE 'varNorth' OR Area LIKE 'varNorthwest' OR Area LIKE 'varNorth_Central' OR Area LIKE 'varSouthwest' OR Area LIKE 'varCentral') AND Apartment_Name LIKE 'varName' AND Zip Like 'varZip' AND District LIKE 'varDistrict' AND Pools LIKE 'varPools' AND Washer_Dryer LIKE 'varWasher_Dryer' AND Access_Gates LIKE 'varAccess_Gates' AND Jacuzzi LIKE 'varJacuzzi' AND Microwave LIKE 'varMicrowave' AND Fireplace LIKE 'varFireplace' AND Pet LIKE 'varPet' AND Large_Pet LIKE 'varLarge_Pet' AND Fitness_Center LIKE 'varFitness_Center' AND Covered_Parking LIKE 'varCovered_Parking' AND Garage LIKE 'varGarage' AND Conn LIKE 'varConn' AND Prov LIKE 'varProv' AND Elementary_School LIKE 'varElem' AND Middle_School LIKE 'varMid' AND High_School LIKE 'varHigh' AND Basketball LIKE 'varBasketball' AND Alarms LIKE 'varAlarms' AND Water_Volleyball LIKE 'varW_Volleyball' AND Tennis LIKE 'varTennis' AND Vaulted_Ceilings LIKE 'varVaulted_Ceilings' AND Jogging_Trail LIKE 'varJogging_Trail' AND Sauna LIKE 'varSauna' AND Raquetball LIKE 'varRaquetball' AND Garden_Tub LIKE 'varGarden_Tub' AND Volleyball LIKE 'varVolleyball' AND Clubroom LIKE 'varClubroom' AND Business_Center LIKE 'varBusiness_Center' AND Attached_Garage LIKE 'varAttached_Garage' AND View LIKE 'varView' AND Laundry LIKE 'varLaundry' AND Patio_Balconet LIKE 'varPatio' AND Low_Price >=varLow_Price AND High_Price <= varHigh_Price GROUP BY Apartment_Info.Apartment_Name, Apartment_Info.Area, Apartment_Info.YearBuilt, Apartment_Info.Bedrooms, Apartment_Info.Apartment_ID, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.State, Apartment_Info.Zip, Unit_Info.Type