Re: Report Sum If <=
- From: ChrisG <ChrisG@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 13:20:38 -0700
Jeff,
I understand you reply but I wasn't able to get it to work. Perhaps my
request is more complicated then I orginally explained. I wanted to get the
sum of the hours for attendance codes and then test for the sum for each
employee where the SUM is <= 24. I afraid I not as knowlegable as I would
like to be on creating function syntax in a query. Any help or direction is
greatly appreciated.
SELECT DISTINCTROW [Employee Info].LastName, Events.EmployeeID,
Events.AttendanceCode, Sum(Events.TimeHours) AS SumOfTimeHours
FROM [Employee Info] RIGHT JOIN Events ON [Employee Info].EmployeeNumber =
Events.EmployeeID
GROUP BY [Employee Info].LastName, Events.EmployeeID, Events.AttendanceCode
HAVING (((Events.AttendanceCode) Like "L" Or (Events.AttendanceCode)="LX" Or
(Events.AttendanceCode)="A" Or (Events.AttendanceCode)="AX" Or
(Events.AttendanceCode)="WC" Or (Events.AttendanceCode)="D" Or
(Events.AttendanceCode)="F" Or (Events.AttendanceCode)="S" Or
(Events.AttendanceCode)="VAX"));
--
ChrisG
"Jeff Boyce" wrote:
Chris.
If I'm understanding what you are trying to do, do it in the query. First
create the new expression (your IIF statement). Then, in the
Selection/Criteria "cell", enter "Yes".
Paraphrased in English, create a calculated value of either "Yes" or "No",
based on the size of my [sum of hours] field, then only return rows where
this calculated value is "Yes".
Regards
Jeff Boyce
Microsoft Office/Access MVP
"ChrisG" <ChrisG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:00A20660-8688-4670-8629-5B884B84ECED@xxxxxxxxxxxxxxxx
I want to make a report from a query that extracts coded events L, LX etc
and
the hours associated with these codes. I need help with the correct
syntax
for this expression.
sum([sum of hours])
IIf ([sum of hours] <= 24, "Yes", "No")
I would like to display only those entries who meet the criteria or flag
the
YES entries.
--
ChrisG
- Follow-Ups:
- Re: Report Sum If <=
- From: Jeff Boyce
- Re: Report Sum If <=
- References:
- Re: Report Sum If <=
- From: Jeff Boyce
- Re: Report Sum If <=
- Prev by Date: Re: Total Textbox Values on a form
- Next by Date: Re: Setting Up Report
- Previous by thread: Re: Report Sum If <=
- Next by thread: Re: Report Sum If <=
- Index(es):
Relevant Pages
|