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

Need help summing multiple date entries 1

Status
Not open for further replies.

ribhead

Technical User
Jun 2, 2003
384
US
I couldn't find this in the FAQ area but I'm sure it has come up. I have a table in Access that is receiving info from a form I have created. The user can have multiple entries on any given day. What I would like to do is sum the hours he/she has for the one day.
I the example below I would like to know how many hours operator 1493 had on 8/27/2004. I would like to display this info in a list box. I'm stuck... how do I get started?

Date Clock Number Hours
8/27/2004 1493 3
8/27/2004 1493 5
8/27/2004 1493 8
8/28/2004 1282 3


Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
The Row Source of the list box would be
SELECT ClockNumber, Date, SUm(Hours)
FROM tblA
GROUP BY CLockNumber, Date;

BTW: Date is a bad name for a field since it is a function name. Also, consider not using spaces in field or any other name you give an object.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks Duane I'll give this a shot. The example is just that I typed it up in XL. I know that I should stay away from using that as a field name. I will use Time instead. Just kidding thanks for the code as well as the heads up.



Thanks, Rib

Bartender:Hey aren't you that rope I threw out an hour ago?

Rope:No, I'm a frayed knot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top