>Hi John,
>
>You didn't mention before that there are possible multiple contribution per name and official combination.
>Here's a query that works on your test data. The new inner subquery gets unique combinations of name&official for specified criteria. The rest is the same as before.
>SELECT name, amount, official, date FROM cmoney ;
> WHERE official IN (?Official1, ?Official2) ;
> AND name IN ( ;
> SELECT name FROM ( ;
> SELECT name, official FROM cmoney ;
> WHERE official = ?Official1 or official = ?Official2 ;
> GROUP BY 1,2 ) ds1 ;
> GROUP BY 1 HAVING COUNT(*) > 1 ;
> ) ;
>
>
Once more, let it be said far and wide - Sergey is the SQL Man!
Thanks Sergey it works wonderfully! This will be a keeper snippet.
John
John Harvey
Shelbynet.com
"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright