Solved

Query to group and sum multiple ID's

Posted on 2008-06-11
2
238 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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