Forums

This topic is locked

Dynamically form a SQL query?

Posted 03 Oct 2006 19:13:36
1
has voted
03 Oct 2006 19:13:36 TDI LTD posted:
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 and bounces back to the front 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.

Note - each of these dropdowns contains an "ALL" entry whose value is "*". I figured a wildcard like that would be what I needed to use, but I think I may be incorrect.

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.

Thanks...

Reply to this topic