Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic Text in WHERE

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-01 : 12:48:55
Mark writes "Hi,

I'm really new to ASP / SQL etc - only been at it for 2 days. Anyways, I'm learning to write an advanced search page and I want to Display all records from a table within a specified range. (eg. Residential Properties within a range between $50000 to $150000) I can do that okay, but I want to have the values passed from a URL Dynamically, stored from Form Selections on a previous page.

I am using UltraDev and tried to setup the following:

SELECT ID, txtListPrice, PRDetails, txtArea etc etc.
FROM Properties
WHERE txtListPrice BETWEEN 'varPriceRangeFrom' AND 'varPriceRangeTo'

When I declare the Variables as follows, it returns a "datatype mismatch in criteria expression"

Name: varPriceRangeFrom
Default Value: 1
Run-time Value: Request.QueryString("txtListPrice")

Name: varPriceRangeTo
Default Value: 1
Run-time Value: Request.QueryString("txtListPrice")

To summarise, I want to make a range selection on an advanced search page (Real Estate - eg. $50,000-$150,000) then pass the Variables to a results page, displaying all records within the dynamically specified range.

Thank you for your help

Mark"
   

- Advertisement -