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

x
?
Solved

SQL query on ASP

Posted on 1998-08-26
4
Medium Priority
?
152 Views
Last Modified: 2010-04-09
I have a form with a pull down list and submit button. The user can select "View All Dealers" or one of any of the other dealers listed thereafter. The value for the "View All Dealers" is all, and the values of all the other dealers have a dealer code from a database.

When the SQL query on the next page runs, it checks for the "All" value... if it is there, one SQL query is generated, otherwise, another SQL query is generated - 2 SQL queries. How can I make this one SQL query... what value should I use for the "View All Dealers" option?

I tried a value of * and set the SQL query WHERE clause to say "WHERE DealerCode LIKE Request.Form("DealerCode")", but that does not work.
0
Comment
Question by:loyaliser
[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
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 0 total points
ID: 1837082
Why not say WHERE DealerCode <> ""

I would assume that all the dealers have codes?  If they do, this will show all the dealers... You do not have to have any value...

0
 
LVL 1

Author Comment

by:loyaliser
ID: 1837083
GOT IT!!!! Thank you.
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1837084
no points :)
0
 
LVL 1

Author Comment

by:loyaliser
ID: 1837085
yes yes... take the points. sorry.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

604 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