SQL query on ASP

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.
LVL 1
loyaliserAsked:
Who is Participating?
 
MasseyMConnect With a Mentor Commented:
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
 
loyaliserAuthor Commented:
GOT IT!!!! Thank you.
0
 
MasseyMCommented:
no points :)
0
 
loyaliserAuthor Commented:
yes yes... take the points. sorry.
0
All Courses

From novice to tech pro — start learning today.