custom query causes database results wizard error

M

Margot

Hi,
I want to make a ‘BETWEEN’-clause with 2 parameters in the database results
wizard, but I keep getting an error message when I test my pages on my
server. Can anyone help me with this? Details are provided below.

I have made 2 webpages. The 1st page is called search.asp and the 2nd one
searchres.asp.
On ‘search.asp’ I have created a form with 2 dropdown boxes which are named:
startprice and endprice.
‘Search.asp’ posts the form results (startprice and endprice) to
‘searchres.asp.’

On ‘searchres.asp’ I have created a results table using the database results
wizard. In the DRW I have made a custom query (my database is called ‘houses’
and contains the column ‘Price_per_month’):

SELECT * FROM Houses WHERE(Price_per_month BETWEEN ::startprice:: AND
::endprice::)

When I test my two pages on the server I get the following error message:
Database Results Wizard Error
The operation failed. If this continues, please contact your server
administrator.

I’ve tried several things to figure out what the problem is:

1. I changed the custom query to:
SELECT * FROM Houses WHERE(Price_per_month = ::startprice::)

2. I changed the custom query to:
SELECT * FROM Houses WHERE(Price_per_month = ::endprice::)

3. I changed the custom query to:
SELECT * FROM Houses WHERE(Price_per_month BETWEEN 0 AND 1500)

These queries all work fine when I run my pages on my server. So how come I
can’t run:
SELECT * FROM Houses WHERE(Price_per_month BETWEEN ::startprice:: AND
::endprice::)

Any help will be greatly appreciated.

Margot
(working with FP2003)
 
T

Ted

If you have a value to compare you car write it like this

SELECT * FROM HousesWHERE (price1< 710 AND price2> 700)
 
M

Margot

Thank you Ted. I completely overlooked that there is also an easy way to do
it. You're my hero.

Margot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top