Solved

Query to group and sum multiple ID's

Posted on 2008-06-11
2
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
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.

752 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