Filter Dates in a union query

G

Guest

hi Im trying to retreieve data between two dates inside a union query but it
returns all dates instead here is the sql statement hoping someone could help
thanks
Danny

SELECT [DATE],[SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast Bell]

UNION SELECT [DATE], [SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast BTS]

WHERE (([DATE]>=[PLEASE ENTER STARTING DATE (DD MM YY)] And [DATE]<=[PLEASE
ENTER END DATE (DD MM YY)]))

ORDER BY [DATE];
 
M

Marshall Barton

Danny said:
hi Im trying to retreieve data between two dates inside a union query but it
returns all dates instead here is the sql statement hoping someone could help
thanks
Danny

SELECT [DATE],[SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast Bell]

UNION SELECT [DATE], [SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast BTS]

WHERE (([DATE]>=[PLEASE ENTER STARTING DATE (DD MM YY)] And [DATE]<=[PLEASE
ENTER END DATE (DD MM YY)]))

ORDER BY [DATE];


Use the same WHERE clause in both select queries.
 
G

Guest

Thanks Very much works like a charm

Marshall Barton said:
Danny said:
hi Im trying to retreieve data between two dates inside a union query but it
returns all dates instead here is the sql statement hoping someone could help
thanks
Danny

SELECT [DATE],[SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast Bell]

UNION SELECT [DATE], [SERVICE],[MARKET],[Workforce],[CORE],[EAST],[WEST]
FROM [416_Forecast BTS]

WHERE (([DATE]>=[PLEASE ENTER STARTING DATE (DD MM YY)] And [DATE]<=[PLEASE
ENTER END DATE (DD MM YY)]))

ORDER BY [DATE];


Use the same WHERE clause in both select queries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top