kskinne
Well-known Member
- Joined
- Feb 17, 2002
- Messages
- 1,267
- Office Version
- 365
- Platform
- Windows
I am not very familiar with SQL and need some help with the following SELECT:
SELECT CpnyID, Acct, SubAcct, FiscYr, Balance
FROM AcctHist
WHERE FiscYr=2004
this sometimes returns data where there are multiple records that have the same account number (Acct) but a different subaccount number (SubAcct), for example like this:
is there any way that i can restructure this query so that it combines all the amounts for the accounts that match, regardless of the subaccount, so that the above results would be displayed with a total for the account and without the subaccount, like this:
thanks,
kevin
SELECT CpnyID, Acct, SubAcct, FiscYr, Balance
FROM AcctHist
WHERE FiscYr=2004
this sometimes returns data where there are multiple records that have the same account number (Acct) but a different subaccount number (SubAcct), for example like this:
1130.00 00.00.00 100.00
1130.00 00.10.00 100.00
1130.00 00.20.00 100.00
is there any way that i can restructure this query so that it combines all the amounts for the accounts that match, regardless of the subaccount, so that the above results would be displayed with a total for the account and without the subaccount, like this:
1130.00 300.00
thanks,
kevin