Solved

SQL query on ASP

Posted on 1998-08-26
4
149 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

707 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