L
laura
Hi, this is a little complicated... I am working on creating an ASP page
which uses an Access database (on the internet). In Access I created 3
nested queries to get the result I need, using the query design window. It
all works fine and I can even run the query (queries) from my ASP page.
The problem that I am having is that I need to filter the records in the
first query to a particular month and year that will be selected by the user
on the Internet.
How can I pass a parameter to the first query? i.e.,
Query 3 looks at Query 2 (Query 3 is the one that I run on the ASP page)
Query 2 looks at Query 1
Query 1 has the date field where I want to select a particular month and
year from the date field. I want it to default originally to current month
and year, which is easy if I put criteria =month(date) and = year(date), but
when the user then wants to look at different months/years.. how can I then
pass this to the query? I don't want to prompt them for the month and year -
these will be chosen from drop down selection boxes Jan-Dec and a list of
years.. 2005, 2006, 2007 etc.. It is these selections that I want to pass to
Query 1.
I could copy all three SQL statements into my ASP page and use two
variables, but I am not sure how to build nested queries doing that.
Thanks
Laura TD
which uses an Access database (on the internet). In Access I created 3
nested queries to get the result I need, using the query design window. It
all works fine and I can even run the query (queries) from my ASP page.
The problem that I am having is that I need to filter the records in the
first query to a particular month and year that will be selected by the user
on the Internet.
How can I pass a parameter to the first query? i.e.,
Query 3 looks at Query 2 (Query 3 is the one that I run on the ASP page)
Query 2 looks at Query 1
Query 1 has the date field where I want to select a particular month and
year from the date field. I want it to default originally to current month
and year, which is easy if I put criteria =month(date) and = year(date), but
when the user then wants to look at different months/years.. how can I then
pass this to the query? I don't want to prompt them for the month and year -
these will be chosen from drop down selection boxes Jan-Dec and a list of
years.. 2005, 2006, 2007 etc.. It is these selections that I want to pass to
Query 1.
I could copy all three SQL statements into my ASP page and use two
variables, but I am not sure how to build nested queries doing that.
Thanks
Laura TD