Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SUM Statment Help

Author  Topic 

ggarza75
Yak Posting Veteran

50 Posts

Posted - 2009-12-22 : 10:40:29
Need some help with a statement. I have a database with many check payments. We're at the end of the year and I need to query some data for my clients.

I have a column called Name and another column called Check Amount.

PersonA, PersonB, PersonC, and so on can have many checks paid to them thoughout the year. Now I need to have all the checks SUMMED up for each person. So instead of viewing all their check payments, how can I have the all the check amounts added up for PersonA and so on.

Thanks for any help.

Ifor
Aged Yak Warrior

700 Posts

Posted - 2009-12-22 : 11:05:33
Try something like:

SELECT [Name], SUM(CheckAmount) AS CheckAmounts
FROM YourTabe
WHERE CheckDate >= '20090101'
AND CheckDate < '20100101'
GROUP BY [Name]
Go to Top of Page
   

- Advertisement -