Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01179984
Message ID:
01179988
Views:
15
Hi John,

Yes, I realized that you get all contributions for people who made donations to those 2 officials. You've to add the same where clause to the main select
SELECT name,amount,official,date FROM cmoney ;
 WHERE name IN (SELECT name FROM cmoney ;
              WHERE official = ?Official1 or official = ?Official2 );
             GROUP BY 1 HAVING COUNT(*) > 1) ;
     AND official = ?Official1 or official = ?Official2 
>
>Here is my select statement and it is giving me more elected officials than it should.
>
>
>SELECT name,amount,official,date FROM cmoney WHERE name IN (SELECT name FROM cmoney ;
>WHERE (official = ?Official1 or official = ?Official2 );
>GROUP BY 1 HAVING COUNT(*) > 1)
>
>I only want records which include (name) contributor who gave to both officials.
>
>john doe,1/1/99,1000.00,A.Politician
>john doe,12/4/98,500.00,B.Politician
>
>Above is a simplification of how the result set should look.
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform