Solved

SQL query on ASP

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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 47
Link not working 6 43
HTML INPUT 6 22
write html in textarea and record it into a database table 3 14
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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.…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

730 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