navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Search Query

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Search Query
Page: [1]
 
pazafuera

 

Posts: 98
Joined: 7/22/2005
Status: offline

 
Search Query - 2/9/2008 1:31:20   
Hello Everybody!

I AM GOING CRAZY HERE! I'm not sure why I can't figure this out, but it's not working.

Rentals Table contains the following field as criteria:

City (text), Bedrooms (number), Bathrooms(number), Porch (text), Patio (text), Pool (text)

The query should find all rentals in the city chosen, with the number of bathrooms & bedrooms chosen, and if the Porch, Patio and Pool options are chosen, then rentals with those options are pulled.

This is what I have:

fp_sQry="SELECT * FROM tblRentals WHERE (RentalCity LIKE '%::RentalCity::%' AND RentalBedrooms >= ::RentalBedrooms:: AND RentalBathrooms >= ::RentalBathrooms:: AND Patio LIKE '::Patio::' AND Pool LIKE '::Pool::' AND Porch LIKE '::Porch::') ORDER BY RentalID DESC"

fp_sDefault="RentalCity=&RentalBedrooms=0&RentalBathrooms=0&Patio=&Pool=&Porch="


When I do a search, and leave the Porch, Patio and Pool options unchecked, it pulls no records. What I want it to do is pull all records, regardless of whether or not they include a porch, patio or pool. If the checkbox "Porch" is checked, THEN only the records with porches will be pulled.

Does that makes sense? Why will this not work!!!!?!

Thanks in advance.
codenamebill26

 

Posts: 15
Joined: 1/19/2008
Status: offline

 
RE: Search Query - 2/9/2008 4:24:23   
this is a shot in the dark but im pretty sure you cant use the * on this so try making it look more like this



fp_sQry="SELECT City , Bedrooms, Porch, Patio, Pool FROM Rentals WHERE (Rental.City LIKE '%::RentalCity::%' AND Rental.Bedrooms >= ::RentalBedrooms:: AND Rental.Bathrooms >= ::RentalBathrooms:: AND Patio LIKE '::Patio::' AND Pool LIKE '::Pool::' AND Porch LIKE '::Porch::') ORDER BY Rental.ID DESC"



i use a access driver not mysql so im not sure really if this will even help.............

(in reply to pazafuera)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Search Query
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts