Want to find average and color code

G

Guest

I have a report that sort overtime hours from low to high and would like to
inclued the average in the header on the report. when I add the average to
header or footer for that mater the sort on the overtime hours become
unsorted. Is there a way fix this and also have the overtime hours color
coded if they are below the average.

I have inclueded the SQL for the report: SELECT Employees.SSI,
Sum(OvertimeTracking.oTDLhOURUSED) AS SumOfoTDLhOURUSED, [Last Name] & ", " &
[First Name] AS Expr2, Employees.Day, Employees.otdeirelist,
OvertimeTracking.Quarter, Sum(OvertimeTracking.oTDLOP) AS SumOfoTDLOP,
Sum(OvertimeTracking.oTBlocked) AS SumOfoTBlocked,
Sum(OvertimeTracking.oVERtIMErEFUSED) AS SumOfoVERtIMErEFUSED,
Format([ActionDate]) AS Expr1
FROM Employees INNER JOIN OvertimeTracking ON Employees.SSI =
OvertimeTracking.EMPiD
WHERE (((OvertimeTracking.aUTHORIZED) Like 1 Or
(OvertimeTracking.aUTHORIZED) Like 4))
GROUP BY Employees.SSI, [Last Name] & ", " & [First Name], Employees.Day,
Employees.otdeirelist, OvertimeTracking.Quarter, Format([ActionDate])
HAVING (((Employees.otdeirelist) Like "10" Or (Employees.otdeirelist) Like
"12") AND ((OvertimeTracking.Quarter)=[Enter Quarter]))
ORDER BY Sum(OvertimeTracking.oTDLhOURUSED);
 
M

Marshall Barton

Nick said:
I have a report that sort overtime hours from low to high and would like to
inclued the average in the header on the report. when I add the average to
header or footer for that mater the sort on the overtime hours become
unsorted. Is there a way fix this and also have the overtime hours color
coded if they are below the average.

I have inclueded the SQL for the report: SELECT Employees.SSI,
Sum(OvertimeTracking.oTDLhOURUSED) AS SumOfoTDLhOURUSED, [Last Name] & ", " &
[First Name] AS Expr2, Employees.Day, Employees.otdeirelist,
OvertimeTracking.Quarter, Sum(OvertimeTracking.oTDLOP) AS SumOfoTDLOP,
Sum(OvertimeTracking.oTBlocked) AS SumOfoTBlocked,
Sum(OvertimeTracking.oVERtIMErEFUSED) AS SumOfoVERtIMErEFUSED,
Format([ActionDate]) AS Expr1
FROM Employees INNER JOIN OvertimeTracking ON Employees.SSI =
OvertimeTracking.EMPiD
WHERE (((OvertimeTracking.aUTHORIZED) Like 1 Or
(OvertimeTracking.aUTHORIZED) Like 4))
GROUP BY Employees.SSI, [Last Name] & ", " & [First Name], Employees.Day,
Employees.otdeirelist, OvertimeTracking.Quarter, Format([ActionDate])
HAVING (((Employees.otdeirelist) Like "10" Or (Employees.otdeirelist) Like
"12") AND ((OvertimeTracking.Quarter)=[Enter Quarter]))
ORDER BY Sum(OvertimeTracking.oTDLhOURUSED);


Remove the ORDER BY clause from the query and use the
SumOfoTDLhOURUSED field in the report's Sorting and
Grouping.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top