F
FB
Need to select top 20 records by location based on the sum of balances. Here
is what I have so far, but it is only giving me the top 20 of all not of each
location; your suggestion is welcome.
Thank you
SELECT TOP 20 account.ProfCtr, account.Own1SSN, account.Own1Name,
Sum(([currentBal])) AS [Total Balance], Count(account.Own1Name) AS [count]
FROM account
GROUP BY account.ProfCtr, account.Own1SSN, account.Own1Name
ORDER BY account.ProfCtr, Sum(([currentBal])) DESC;
is what I have so far, but it is only giving me the top 20 of all not of each
location; your suggestion is welcome.
Thank you
SELECT TOP 20 account.ProfCtr, account.Own1SSN, account.Own1Name,
Sum(([currentBal])) AS [Total Balance], Count(account.Own1Name) AS [count]
FROM account
GROUP BY account.ProfCtr, account.Own1SSN, account.Own1Name
ORDER BY account.ProfCtr, Sum(([currentBal])) DESC;