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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query help...

Status
Not open for further replies.

ccoffelt

Technical User
Jan 17, 2006
35
US
I have a query that shows the same workorder several times because they have worked on them different hours/different days. This is what it looks like when I run the query.

Start Date WO# Name Hrs

7/7/08 285324 HW 3
7/22/08 285324 HW 6
7/23/08 285324 HW 2

7/8/08 285324 JW 4
7/10/08 285324 JW 2
7/22/08 285324 JW 1

7/1/08 285324 BM 1
7/2/08 285324 BM 2

I would like just a total of their hours for that workorder like so:

Start Date WO# Name Hrs

7/7/08 285324 HW 11
7/22/08 285324 JW 7
7/23/08 285324 BM 3

Can anyone offer suggestions? Thanks
 
Select [wo#],[name],min([date]) as StattDate,sum(hrs) as SumHours
from tablename
Group by [wo#],[name],
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top