M
mdavison
Its been quite some time since I've effectivly used to Totals button (sigma)
in a query. Please help!
My data is relevant to employee 401K stuff, where each record relates to
values for a pay-period. I want my query to total (on the relevant $ amount
fields) just the totals for the year to date for each field, but I can't
remember how to achieve that. But I know I've achieved something like this
in the past.
The primary key is an auto-count since the name and social security are
repeated based on pay period date - the owner of this file didn't know about
using multi-field keys and its a little late to make that change now. Is it
possible this "ID" field is getting in my way?
Thanks in advance!
-Monica
I'm not a big SQL person, but in the interest of providing data, below is
the SQL version of my query:
SELECT Assoc.ID, Sum(Assoc.[YTD Gross Earnings]) AS [SumOfYTD Gross
Earnings], Assoc.Name, Assoc.[Social Security Number], Assoc.[Contribution
Type], Assoc.[Employee Pre-Tax Deferral], Sum(Assoc.[Employer Match]) AS
[SumOfEmployer Match], Sum(Assoc.[Employee Loan]) AS [SumOfEmployee Loan],
Sum(Assoc.[Employee Roth]) AS [SumOfEmployee Roth], Sum(Assoc.[Employer
Discr/Prof Sharing]) AS [SumOfEmployer Discr/Prof Sharing],
Sum(Assoc.[Employee Rollover]) AS [SumOfEmployee Rollover],
[Assoc-Dates].[Hire Date], [Assoc-Dates].[Termination Date]
FROM Assoc LEFT JOIN [Assoc-Dates] ON Assoc.Name = [Assoc-Dates].Name
GROUP BY Assoc.ID, Assoc.Name, Assoc.[Social Security Number],
Assoc.[Contribution Type], Assoc.[Employee Pre-Tax Deferral],
[Assoc-Dates].[Hire Date], [Assoc-Dates].[Termination Date];
in a query. Please help!
My data is relevant to employee 401K stuff, where each record relates to
values for a pay-period. I want my query to total (on the relevant $ amount
fields) just the totals for the year to date for each field, but I can't
remember how to achieve that. But I know I've achieved something like this
in the past.
The primary key is an auto-count since the name and social security are
repeated based on pay period date - the owner of this file didn't know about
using multi-field keys and its a little late to make that change now. Is it
possible this "ID" field is getting in my way?
Thanks in advance!
-Monica
I'm not a big SQL person, but in the interest of providing data, below is
the SQL version of my query:
SELECT Assoc.ID, Sum(Assoc.[YTD Gross Earnings]) AS [SumOfYTD Gross
Earnings], Assoc.Name, Assoc.[Social Security Number], Assoc.[Contribution
Type], Assoc.[Employee Pre-Tax Deferral], Sum(Assoc.[Employer Match]) AS
[SumOfEmployer Match], Sum(Assoc.[Employee Loan]) AS [SumOfEmployee Loan],
Sum(Assoc.[Employee Roth]) AS [SumOfEmployee Roth], Sum(Assoc.[Employer
Discr/Prof Sharing]) AS [SumOfEmployer Discr/Prof Sharing],
Sum(Assoc.[Employee Rollover]) AS [SumOfEmployee Rollover],
[Assoc-Dates].[Hire Date], [Assoc-Dates].[Termination Date]
FROM Assoc LEFT JOIN [Assoc-Dates] ON Assoc.Name = [Assoc-Dates].Name
GROUP BY Assoc.ID, Assoc.Name, Assoc.[Social Security Number],
Assoc.[Contribution Type], Assoc.[Employee Pre-Tax Deferral],
[Assoc-Dates].[Hire Date], [Assoc-Dates].[Termination Date];