Skip to Content
0
Former Member
Dec 05, 2008 at 02:37 PM

Filter by many fields

21 Views

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.