SQL union query with multiple parameters not working

afsid

New member
Joined
Apr 23, 2019
Messages
1
Reaction score
0
Points
0
Excel Version(s)
2010
I am trying to write a sql query in excel with a union clause and date parameters as below:

SELECT
user.desc,
user.name,
user.dob,
app.appointdate
from
user.usereeid=app.appointid
where app.appointdate Between ? And ?
Union
SELECT
user.desc,
user.name,
user.dob,
user.datecleared
from
employee
WHERE user.datecleared Between ? And ?

I have written this query in Connection Properties > Definition > Command text.this query works when i don't add the last parameter line WHERE user.datecleared Between ? And ? .How can i let it work this query for both parameter?
 
Back
Top