summary report

Joanna_gr

Board Regular
Joined
Feb 16, 2002
Messages
149
well here I am, stuck again! :cry: I need to create a summary reprt which includes a PersonName and a TotalHours fields (Hours from the beginning of theyear till now). I managed to group People and used =Sum[TotalHours] function to summarize field TotalHours. My problem is that next to each name with the total hours i need to display a sum of hours of the last month. maybe it has to do with the query but this moment I can't thing anything ... Help please!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Joanna
In your underlying query, you could use something like the following SQL (In your query design, click View -> SQL View) to calculate the total hours since the start of the year, as well as the hours for the last completed month :
Code:
SELECT tablename.name, Sum(tablename.hours) AS SumOfhours, Sum(IIf([date]>= DateAdd("m",-1,DateAdd("d",-Day(Date())+1,Date())) And [date] <=DateAdd("d",-Day(Date()),Date()), [hours],0)) AS Last_Month
FROM tablename
WHERE (((tablename.date)>=#01/01/2005#))
GROUP BY tablename.name;
This will calculate the hours for the previous month for each employee and put it into a field called 'Last_Month' which you can then add to your report. If this isn't quite right, post a reply. Note that you will need to manually change the criteria in January 2006 for next year. You might not be able to use this query for both reports (per your previous post) - so you may need one query for each report.
HTH, Andrew. :)
 
Upvote 0

Forum statistics

Threads
1,221,907
Messages
6,162,777
Members
451,788
Latest member
Hideoshie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top