Guest_imported
New member
- Jan 1, 1970
- 0
To anyone who can help,
I'm a complete newbie to sql. I'm using an access database and active server pages for my new web site. The site is an online apartment search and I have two tables, one with the different apartment complex information, and one with every different floorplan of the apartments. I've been doing the search on a per unit basis. The problem is that if the search is broad then many units will show up from the same complex which seems a little redundant. I'd like to have each complex show up individually and then the user can click on a detail page for more information. I'd like the query to show the low price and high price for every unit at that particular complex that would meet the search criteria. Here is the code that I'm using below. Thanks in advance.
SELECT Apartment_Info.Apartment_ID, Apartment_Info.Apartment_Name, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.State, Apartment_Info.Zip, Apartment_Info.Area, Apartment_Info.Apartments_Image, Apartment_Info.Location, Apartment_Info.YearBuilt, Apartment_Info.Number_of_Units, Apartment_Info.Management, Apartment_Info.Hrs, Apartment_Info.District, Apartment_Info.Elementary_School, Apartment_Info.Middle_School, Apartment_Info.High_School, Apartment_Info.Access_Gates, Apartment_Info.Alarms, Apartment_Info.Pet, Apartment_Info.Large_Pet, Apartment_Info.Pet_Comments, Apartment_Info.Application_Fee, Apartment_Info.Lease_Periods, Apartment_Info.Corporate_Units, Apartment_Info.Short_Term_Lease, Apartment_Info.Covered_Parking, Apartment_Info.Garage, Apartment_Info.Pools, Apartment_Info.Pool_Qnty, Apartment_Info.Laundry, Apartment_Info.Tennis, Apartment_Info.Volleyball, Apartment_Info.Water_Volleyball, Apartment_Info.Fitness_Center, Apartment_Info.Jogging_Trail, Apartment_Info.Raquetball, Apartment_Info.Basketball, Apartment_Info.Clubroom, Apartment_Info.Jacuzzi, Apartment_Info.Specials, Apartment_Info.Phone_Number, Apartment_Info.Comments, Apartment_Info.Sauna, Apartment_Info.Business_Center, Apartment_Info.View, Unit_Info.Unit_ID, Unit_Info.Plan, Unit_Info.Description, Unit_Info.Type, Unit_Info.SqFt, Unit_Info.Low_Price, Unit_Info.High_Price, Unit_Info.Deposit, Unit_Info.Fireplace, Unit_Info.Washer_Dryer, Unit_Info.Conn, Unit_Info.Prov, Unit_Info.Icemaker, Unit_Info.Microwave, Unit_Infutside_Storage, Unit_Info.Loft, Unit_Info.Townhome, Unit_Info.Study, Unit_Info.Sunroom, Unit_Info.Den, Unit_Info.Garden_Tub, Unit_Info.Walk_in_Closet, Unit_Info.Vaulted_Ceilings, Unit_Info.Linen_Closet, Unit_Info.Floorplan_Path, Unit_Info.Patio_Balconet
FROM Apartment_Info INNER JOIN Unit_Info ON Apartment_Info.Apartment_ID = Unit_Info.Apartment_ID
WHERE Apartment_Name LIKE 'varName' AND Type LIKE 'varType' AND Area LIKE 'varArea' AND Pools LIKE 'varPools' AND Washer_Dryer LIKE 'varWasher_Dryer' AND District LIKE 'varDistrict' 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 Zip Like 'varZip' 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
ORDER BY Apartment_Name, SqFt
I'm a complete newbie to sql. I'm using an access database and active server pages for my new web site. The site is an online apartment search and I have two tables, one with the different apartment complex information, and one with every different floorplan of the apartments. I've been doing the search on a per unit basis. The problem is that if the search is broad then many units will show up from the same complex which seems a little redundant. I'd like to have each complex show up individually and then the user can click on a detail page for more information. I'd like the query to show the low price and high price for every unit at that particular complex that would meet the search criteria. Here is the code that I'm using below. Thanks in advance.
SELECT Apartment_Info.Apartment_ID, Apartment_Info.Apartment_Name, Apartment_Info.Address, Apartment_Info.City, Apartment_Info.State, Apartment_Info.Zip, Apartment_Info.Area, Apartment_Info.Apartments_Image, Apartment_Info.Location, Apartment_Info.YearBuilt, Apartment_Info.Number_of_Units, Apartment_Info.Management, Apartment_Info.Hrs, Apartment_Info.District, Apartment_Info.Elementary_School, Apartment_Info.Middle_School, Apartment_Info.High_School, Apartment_Info.Access_Gates, Apartment_Info.Alarms, Apartment_Info.Pet, Apartment_Info.Large_Pet, Apartment_Info.Pet_Comments, Apartment_Info.Application_Fee, Apartment_Info.Lease_Periods, Apartment_Info.Corporate_Units, Apartment_Info.Short_Term_Lease, Apartment_Info.Covered_Parking, Apartment_Info.Garage, Apartment_Info.Pools, Apartment_Info.Pool_Qnty, Apartment_Info.Laundry, Apartment_Info.Tennis, Apartment_Info.Volleyball, Apartment_Info.Water_Volleyball, Apartment_Info.Fitness_Center, Apartment_Info.Jogging_Trail, Apartment_Info.Raquetball, Apartment_Info.Basketball, Apartment_Info.Clubroom, Apartment_Info.Jacuzzi, Apartment_Info.Specials, Apartment_Info.Phone_Number, Apartment_Info.Comments, Apartment_Info.Sauna, Apartment_Info.Business_Center, Apartment_Info.View, Unit_Info.Unit_ID, Unit_Info.Plan, Unit_Info.Description, Unit_Info.Type, Unit_Info.SqFt, Unit_Info.Low_Price, Unit_Info.High_Price, Unit_Info.Deposit, Unit_Info.Fireplace, Unit_Info.Washer_Dryer, Unit_Info.Conn, Unit_Info.Prov, Unit_Info.Icemaker, Unit_Info.Microwave, Unit_Infutside_Storage, Unit_Info.Loft, Unit_Info.Townhome, Unit_Info.Study, Unit_Info.Sunroom, Unit_Info.Den, Unit_Info.Garden_Tub, Unit_Info.Walk_in_Closet, Unit_Info.Vaulted_Ceilings, Unit_Info.Linen_Closet, Unit_Info.Floorplan_Path, Unit_Info.Patio_Balconet
FROM Apartment_Info INNER JOIN Unit_Info ON Apartment_Info.Apartment_ID = Unit_Info.Apartment_ID
WHERE Apartment_Name LIKE 'varName' AND Type LIKE 'varType' AND Area LIKE 'varArea' AND Pools LIKE 'varPools' AND Washer_Dryer LIKE 'varWasher_Dryer' AND District LIKE 'varDistrict' 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 Zip Like 'varZip' 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
ORDER BY Apartment_Name, SqFt