Solved

Query to group and sum multiple ID's

Posted on 2008-06-11
2
224 Views
Last Modified: 2011-10-19
I have run aground on creating a Query to Sum up values in a month and by a Employee ID.  There are multiple columns that hold values but they all should be summed by for the month and by Employee ID.
I have included what I have but based on a where clause for 1 employeeID but there can't be a condition for just one employeeid, the query has to group by the employeeID placing all summed values for that employeeID in the appropriate month etc.
uggg.
Any help would be awesome.
**The screen is from a PostGreSQL screen, but the query syntax is what I am looking for in SQL Server etc**
groupAE-IDsQuery.jpg
0
Comment
Question by:wayneburr
2 Comments
 
LVL 5

Accepted Solution

by:
rstomar earned 500 total points
ID: 21766225
add following to ur query :
SELECT  employeeid, admonth, ............................................
..........................................
WHERE (forweek = 22) and (foryear = 2008)
GROUP BY employeeid, admonth
ORDER BY employeeid, admonth
0
 

Author Closing Comment

by:wayneburr
ID: 31466441
(Group by) - Man, talking about missing it :)  It's time to just walk away.
Thanks a bunch!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now