I my query, I need filter by date field (trough query manager variable), but I need get the value of diferents fields of sistem tables, for example (I do this, but I can't select a value of the filter because doesn't return nothing):
Select @cnt = count(*) from (
SELECT DocDate FROM [dbo].[OPCH]
union
SELECT DocDate FROM [dbo].[ORPC]
union
SELECT DocDate FROM [dbo].[ODPO]) T0 WHERE T0.DocDate = '[%0]'
Any sugestion?
Roberto.