|
-
March 29th, 2005, 07:56 AM
#1
Nested parameter queries in access 2000.
Hi all
I have an Access 2000 DB. In it i have a query Q1:
Code:
PARAMETERS DATE_FROM DateTime, DATE_TO DateTime;
SELECT *
FROM TABLE_1
WHERE (TABLE_1.tb1_Date>=DATE_FROM) And (TABLE_1.tb1_Date<=DATE_TO);
I would like to call Q1 from within Q2. How do i pass the DATE_FROM and DATE_TO parameters from Q2 to Q1? I tried to create a Q2 like this:
Code:
SELECT *
FROM Q1
WHERE (DATE_FROM=#1/1/2005#) And (DATE_TO=#12/31/2005#);
but of course it didn't work.
-------------------------
Nick A.
-
March 30th, 2005, 11:10 PM
#2
Re: Nested parameter queries in access 2000.
Did U try this:
Code:
PARAMETERS DATE_FROM DateTime, DATE_TO DateTime;
SELECT *
FROM Q1
WHERE (DATE_FROM=#1/1/2005#) And (DATE_TO=#12/31/2005#);
-
March 31st, 2005, 01:48 AM
#3
Re: Nested parameter queries in access 2000.
 Originally Posted by Krzemo
Did U try this:
Code:
PARAMETERS DATE_FROM DateTime, DATE_TO DateTime;
SELECT *
FROM Q1
WHERE (DATE_FROM=#1/1/2005#) And (DATE_TO=#12/31/2005#);
Um, it probably wouldn't help declaring DATE_FROM and DATE_TO as parameters in Q2. They are Q1's parameters, i just wanted to assign a value to them in Q2 and pass them to Q1 in order to execute the statement. I probably should have written the following (it still wouldn't work but it would be more clear what i wanted to do:
Code:
WHERE (Q1.DATE_FROM=#1/1/2005#) And (Q1.DATE_TO=#12/31/2005#);
I haven't found how to do this yet, event though i searched everywhere i could think of. It probably can't be done... Anyway, i found another solution to the problem i had. Thanks for your answer.
-------------------------
Nick A.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|