Solved

Query to group and sum multiple ID's

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

627 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