PDA

View Full Version : Monthly average Query/or report


ashley velez
Jun 24, 2009, 12:51 PM
At my work we have a "sign in sheet" table...
I have created a query that calculates daily time, but when I try to create a report that shows weekly average hours, It gives me the daily average for each week, I assume I need to change the "DailyTime" column in my report to calculate weekly time, but I don't know how to do that.

Can anyone help me?

I have attached screen shots of the query, and the table that the query comes from...

The daily time code I am using in my query is
Daily Time: Round(IIf(IsNull([Time Out Lunch]),DateDiff("n",[Time In AM],[Time Out PM]),DateDiff("n",[Time In AM],[Time Out Lunch])+DateDiff("n",[Time In Lunch],[Time Out PM]))/60,2)

ScottGem
Jun 24, 2009, 01:14 PM
Ok, this is what I was getting out in my other post. To do what you want is fairly easy. What you need to do is first add a column to your query:

WeekTot: Datepart("ww",[Datefield])

Then make your query a Group By query and gropup on the WeekTot column first. Then sum the time.

Do the same only grouping by month.

ashley velez
Jun 25, 2009, 01:33 PM
Do I literally write date filed, or do I put a date filed in those brackets how do I only group on the weektot column, and get a sum.. I am sorry I am just confused