Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Count of several groups 2

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
I have a table that looks like this well at least part of it does.

Time Area Work Date
----------------------------------------
1 Payments Tickets 1/9/03
1.5 Other Development 1/9/03
.5 Payments Development 1/9/03
.25 NT R&D 1/10/03
3 Payments Development 1/9/03

Work is a sub section of area. I want to be able to sum up the time for each Area broken down by Work.

So I want to get a result like this.

Payments Tickets 1
Payments Development 3.5
NT R&D .25
Other Development 1.5

I know I will kick myself when I see it but I just cant get the right statement to get this result.

Thank You in advance for any help.
AJ
I would lose my head if it wasn't attached. [roll1]
 
Hi

This should work:

select area, work, date, sumtime)
from table
group by area, work, date

Hope this helps

John
 
Hi

You can take out the DATE column as this wasn't part of your requirement. And sorry for the typo..it should be
sum(time)

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top