Solved

SQL query on ASP

Posted on 1998-08-26
4
141 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
Comment Utility
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
Comment Utility
GOT IT!!!! Thank you.
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
no points :)
0
 
LVL 1

Author Comment

by:loyaliser
Comment Utility
yes yes... take the points. sorry.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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 style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now