>I am doing a search and I would like the base result to consider only keeping those records where the found primary keys have an interception with a sub table.
>
>Here is an example of a simulation scenario assuming we would like to search for members into which they share the same clients:
>
>
>DECLARE @Parameter1 Varchar(16)
>DECLARE @Parameter2 Varchar(14)
>
>SET @Parameter1='FOURNIER%'
>SET @Parameter2='FOURNIER%'
>
>SELECT Member.Numero
>FROM Member
>WHERE (Member.FirstName LIKE @Parameter1 OR Member.LastName LIKE @Parameter2) AND
> EXISTS
> (
> SELECT Invoice.NoClient FROM Invoice WHERE Invoice.NoMember=Member.Numero
> INTERSECT
> SELECT Invoice.NoClient FROM Invoice WHERE Invoice.NoMember=1
> )
>
>
>The problem with that syntax is that it returns members which do not intercept at the invoice level. So, the syntax has to be fine tuned to consider that. Anyone could find what is wrong?
It's not very clear - at all, you restrict the result to Member number = 1
Don't think you need the INTERSECT and the SELECT just after
Gregory