Filter Dates in a union query

  • Thread starter Thread starter Guest
  • Start date Start date
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];
 
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.
 
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.
 
Back
Top