Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Query Issue: 2 form fields with min and max.

Posted on 2006-11-29
1
Medium Priority
?
173 Views
Last Modified: 2013-12-24
I keep getting the error: Syntax error (Missing operator) when I add 2 forms.  

search page---

      <select name="minprice">
      <option value="1"> no min </option>
            <option value="300000"> 300,000 </option>
      </select>  max

                 <select name="maxprice">
      <option value="9999999999"> no max </option>
      <option> 400,000 </option>

action page---

SELECT reals_id, zip.zip, city.city, state.state, price
FROM reals, zip, city, state
WHERE (0=0)
      AND reals.city = city.city_id
      AND reals.state = state.state_id
      AND reals.zip=zip.zip_id
-------------------------------------------------------------------
      AND reals.price GTE '#Session.minprice#'
      AND reals.price LTE '#Session.maxprice#'
--------------------------------------------------------------------
      AND city.city LIKE '#Session.scity#%'
      AND state.state LIKE '#Session.sstate#%'
      AND zip.zip LIKE '#Session.szip#%'

It works fine without the 2 lines of code in between the dashes...
I have a hunch I need to convert string to number

Any help will be greatly appreciated.




                        
0
Comment
Question by:sjha81
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 25

Accepted Solution

by:
dgrafx earned 2000 total points
ID: 18035576
1) in your db - is the field reals.price a datatype of money?
if yes, then remove the ' ' from around the value
the only time you'd use ' ' around the value is if it's a varchar or text field.
2) are you setting your session.minprice & session.maxprice before the code shown here (on action page)
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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