Solved

Search form using Dreamweaver MX 2004, ASP.NET and MsSQL

Posted on 2004-08-14
1
297 Views
Last Modified: 2010-04-25
I’m trying to get a search form using Dreamweaver MX 2004, ASP.NET and MsSQL.
The search page is for a realtor site and needs to be able to search the following field: (City and State OR Zip Code) then (PriceMin to PriceMax  AND OR Bed AND OR Bath) OR MLS# , here is the last of many mistakes.

SELECT *
FROM dbo.rDescription
WHERE (((dCuID = '117836543') AND ((dbo.rDescription.dCity = @dCity AND dbo.rDescription.dState = @dState) OR (dbo.rDescription.dZipcode = dZipcode)) AND ((dbo.rDescription.dPrice >= @PriceMin AND dbo.rDescription.dPrice >= @PriceMax And dbo.rDescription.dBed >= @dBed And dbo.rDescription.dBath >= @dBath OR dbo.rDescription.MLS = @MLS)))

Paramaters:

@dCity  Value =  IIf((Request.Form("dCity ") <> Nothing), Request.Form("dCity "), "")
@dState  Value =  IIf((Request.Form("dState") <> Nothing), Request.Form("dState"), "")
@dZipcode  Value =  IIf((Request.Form("dZipcode") <> Nothing), Request.Form("dZipcode"), "")
@PriceMin  Value =  IIf((Request.Form("PriceMin") <> Nothing), Request.Form("PriceMin"), "")
@PriceMax  Value =  IIf((Request.Form("PriceMax") <> Nothing), Request.Form("PriceMax"), "")
@dBed  Value =  IIf((Request.Form("dBed") <> Nothing), Request.Form("dBed"), "")
@dBath  Value =  IIf((Request.Form("dBath") <> Nothing), Request.Form("dBath"), "")
@MLS  Value =  IIf((Request.Form("MLS") <> Nothing), Request.Form("MLS"), "")

Form Fields:

dCity, dState, dZipcode, PriceMin, PriceMax, dBed, dBath, MLS
0
Comment
Question by:ajstubblefield
1 Comment
 
LVL 9

Accepted Solution

by:
prifre earned 500 total points
ID: 11805765
Hi,

I would probably use "LIKE" and some "%" instead of just "=" to compare the strings.

Anyhow,
"dbo.rDescription.dPrice >= @PriceMin AND dbo.rDescription.dPrice >= @PriceMax"  ... seems a little funny
I think it should be:
"dbo.rDescription.dPrice >= @PriceMin AND dbo.rDescription.dPrice <= @PriceMax"

with a smile
/prifre
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question