
October 3rd, 2006, 12:44 PM
|
|
Registered User
|
|
Join Date: Oct 2006
Posts: 1
Time spent in forums: 10 m 43 sec
Reputation Power: 0
|
|
|
Use multiple dropdowns to dynamically populate a SQL query
Hi,
So here's the scenario: I am using an access database and .ASP pages. I have a page that a user enters metrics on (in a form). They hit submit and it bounces the data to a page that shows (read-only) what they entered to confirm their input. They hit submit and it processes the form (enters the data into the database) and bounces back to the first page so they can make a new entry.
When they're done, I want them to be able to look over the details they've entered for the month they are reporting. So I pull all data entered on the month and year according to their system clock.
Well, management wants to be able to filter through things by different means, such as everyone's data for a month, or everyone's data over a year, or one person's data for a particular month or entire year, or a division's data regardless of the user of month or year, etc.
So I have four dropdowns to make these seletions: user, division, month, and year. The catch is I don't know how to write a SQL query to use input from these dropdowns.
For the record, I'm fairly new to troubleshooting SQL statements and am self-taught on just HTML and a bit of ASP. But the job needs to be done and I'm the closest one with skill enough to kind of muddle through it. I don't do this for a living, so please have patience in your responses.
I know how to pull specific things from the database and display them, just not how to filter for selected entries from a set of dropdowns. I think I need an odd "WHERE" statement, but I'm guessing, and I'm not sure what to look for on google or in a book/tutorial/forum.
Thanks...
|