Actually, I think it is very close. I see a couple of un-matched parenthesis:
SELECT [OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM [UnionQuery1]
WHERE (OrderDate.Between [Enter begin date:] And [Enter end date:])[/b}
UNION SELECT [OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM [UnionQuery2]
WHERE (OrderDate.Between [Enter begin date:] And [Enter end date:]);
These are indicated by the ADDITION of ) where I think the are necessary. I also added a few spaces to seperate KeyWords from the arguments. With out a set of tables to test it on, this is about as far as I can take your specific request.
I duped a sample table in one of my teaching databases and did a Union query on the duplicated table. Teh SQL is shown below. It is not EXACTLY the same, as I did not use the two parameters, but just placed the criteria directly in the SQL statement, however this should make no real difference in the process. Examine the SQL below and compare it to the one above. I believe the only differences are the spaces, the Parameters and the inclusion in the one below of the KeyWord ALL. this last difference MAY be of use to you, and you certainly need to understand it's function. Without the KeyWord "ALL" in the Union query, it -UNLIKE MOST SQL CLAUSES- will remove Duplicate Records. So, IF you wnat ALL records from the Various Sources, - even if they are duplicates, You MUST include the ksyword "ALL". If you have MUltiple "Unions", you need to Include it with EACH Union Clause.
SELECT StuName, ASgn01, Asgn03 From tblGrade Where StuName = "Michael Red"
Union all SELECT StuName, ASgn01, Asgn03 From tblGrade Where StuName = "Michael Red";
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over