If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Running Total Help
A mate of mine posted a question recently but had a bit of difficulty so
let's give this a shot. I am building this as a subquery to hopefully make it easier as the original had FTE as a calculation as opposed to an actual data field. Clear as mud? I've done similar before but can't seem to get it going this time around. What we would like is to get a running total of the field FTE for this query: SELECT [FTE-SVTRA].[Employee Name], [FTE-SVTRA].FTE FROM [FTE-SVTRA]; Thanks for your time. |
#2
|
|||
|
|||
Running Total Help
OShea:
Consider a strategy from Access Hacks by O'Reilly, Hack #43. SELECT FTE-SVTRA.Employee Name, FTE-SVTRA.Employee No, FTE-SVTRA.FTE FROM FTE-SVTRA UNION ALL SELECT "Total" AS cEmployee Name, "Total" AS Employee No, Sum(FTE-SVTRA.FTE) as SumofFTE FROM FTE-SVTRA ORDER BY FTE-SVTRA.Employee No; This is a union query which will 'append' the running total of all FTE for all Employees. If you use the Order By clause it will cause the 'Total' row to appear as the last row of your data. Seth Schwarm "OShea" wrote: A mate of mine posted a question recently but had a bit of difficulty so let's give this a shot. I am building this as a subquery to hopefully make it easier as the original had FTE as a calculation as opposed to an actual data field. Clear as mud? I've done similar before but can't seem to get it going this time around. What we would like is to get a running total of the field FTE for this query: SELECT [FTE-SVTRA].[Employee Name], [FTE-SVTRA].FTE FROM [FTE-SVTRA]; Thanks for your time. |
#3
|
|||
|
|||
Running Total Help
Thanks for the response. But it is telling me it is missing an operator when
I try to run it. "Seth Schwarm" wrote: OShea: Consider a strategy from Access Hacks by O'Reilly, Hack #43. SELECT FTE-SVTRA.Employee Name, FTE-SVTRA.Employee No, FTE-SVTRA.FTE FROM FTE-SVTRA UNION ALL SELECT "Total" AS cEmployee Name, "Total" AS Employee No, Sum(FTE-SVTRA.FTE) as SumofFTE FROM FTE-SVTRA ORDER BY FTE-SVTRA.Employee No; This is a union query which will 'append' the running total of all FTE for all Employees. If you use the Order By clause it will cause the 'Total' row to appear as the last row of your data. Seth Schwarm "OShea" wrote: A mate of mine posted a question recently but had a bit of difficulty so let's give this a shot. I am building this as a subquery to hopefully make it easier as the original had FTE as a calculation as opposed to an actual data field. Clear as mud? I've done similar before but can't seem to get it going this time around. What we would like is to get a running total of the field FTE for this query: SELECT [FTE-SVTRA].[Employee Name], [FTE-SVTRA].FTE FROM [FTE-SVTRA]; Thanks for your time. |
Thread Tools | |
Display Modes | |
|
|