>>>>>>>I'm having a Monday morning brain fart. In my query, I am performing a union against several tables to return one result set. I'd like to perform a where clause against that entire result set, but I'm not figuring out how to do it.
>>>>>>>
>>>>>>>Something like:
>>>>>>>
>>>>>>>
>>>>>>>SELECT * FROM
>>>>>>>(
>>>>>>>
>>>>>>>)
>>>>>>>WHERE MyField = @MyFilter
>>>>>>>
>>>>>>
>>>>>>Try using derived table (or CTE), e.g.
>>>>>>
>>>>>>;with cte as (Here goes UNIONoned query)
>>>>>>
>>>>>>select * from cte where ...
>>>>>
>>>>>Hi Naomi,
>>>>>Your response took 2 minutes. I'd appreciate it if you could cut that down to 1 minute in the future. I am a busy person. (JUST KIDDING, thanks for the prompt response!)
>>>>
>>>>Smart of you to put kidding in upper case as some with big ego will not understand a joke unless you explicitly and unequivocally indicate that you are not serious. This, of course, does not apply to all present in this thread.
>>>
>>>I try to be very explicit, especially when dealing with potential language barriers.
>>
>>I know what you mean. Whenever I talk to people from UK I try to use simpler words <g>.
>
>Sorry, I don't understand what you mean ?
Here we go with the thread drift (please see your Oxford dictionary for the definition of "drift" <g>).
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham