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

Sum on field and select specific on another

Status
Not open for further replies.

nuVBer

Programmer
Jul 6, 2001
63
US
I have a complex query I need help with: The table looks like this:

Comp_sk Prod_dt Rsn Down_hrs
1 7/25/2001 bb 8
2 5/1/2001 ms 12
2 5/18/2001 ga 14
2 5/25/2001 bb 12
2 8/1/2001 cc 7
2 8/15/2001 de 8
3 7/22/2001 ee 15
3 7/15/2001 er 9

I need to return a recordset that will give me each record that has the lastest date of each month, the total (sum) of the "down_hrs" for all records in that month and the other data in each of those records. ie
The set:

1 7/25/2001 bb 8
2 5/25/2001 bb 45
3 7/22/2001 ee 24

Is there any way to do this in a single query?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top