Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Group By
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00803720
Message ID:
00803724
Views:
8
This message has been marked as the solution to the initial question of the thread.
You would group on all of them
SELECT employeid, lastname, firstname, payamt,  ;
 paydate, payhow, checknum,  SUM(payamt) ;
 FROM appdata!mydata ;
 GROUP BY employeid, lastname, firstname, payamt,  ;
 paydate, payhow, checknum
>Just a little help on this one. Select-sql statements are not my strong point sometimes.
>
>In the following for each person (employid), I need one row with a total for payamt for each employid who's paydate, payhow, and checknum are the same.
>
>So, if one record has:
> employeid = '9875'
> paydate = '06/01/2003'
> payhow = 'Check'
> checknum = '101'
> payamt = 100.00
>
>and another record has:
> employeid = '9875'
> paydate = '06/01/2003'
> payhow = 'Check'
> checknum = '101'
> payamt = 155.00
>
>and another record has:
> employeid = '9875'
> paydate = '06/15/2003'
> payhow = 'Check'
> checknum = '102'
> payamt = 75.00
>
>I need to get 2 rows - one with the $255 payamt, and the 2nd one with the $75 payamt.
>
>
>SELECT Mydata.employeid, Mydata.lastname, Mydata.firstname, Mydata.payamt, ;
>  Mydata.paydate, Mydata.payhow, Mydata.checknum ;
> FROM appdata!mydata
>
>
>What GROUP BY would I add to the above statement to give me the results I require?
>
>Mel Cummings
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform