G
Guest
the lst post looks like its hard to read I hope this is better:
Department Employee Employee Total Dept Total
42200-Road Frank 2 2
33000- Sheriff Orrin 1
1
33260- County Jail Ken 3
3
42200- Road Steve 1 3
33000-Sheriff Jeff 1
2
33260-County Jail Alan 3 6
--
LHEMA
Department Employee Employee Total Dept Total
42200-Road Frank 2 2
33000- Sheriff Orrin 1
1
33260- County Jail Ken 3
3
42200- Road Steve 1 3
33000-Sheriff Jeff 1
2
33260-County Jail Alan 3 6
--
LHEMA
LHEMA said:Sorry for your frustration but maybe I am not being clear, here is another
example
Department Employee Employee Total
Dept Total
42200-Road Frank 2
2
33000- Sheriff Orrin 1
1
33260- County Jail Ken 3
3
42200- Road Steve 1
3
33000-Sheriff Jeff 1
2
33260-County Jail Alan 3
6
I hope that helps
--
LHEMA
Duane Hookom said:Recently I have asked posters to "manually type a few records into a reply".
I'm not sure what it is about this request but it seems very difficult for
the OP to comply. This thread is nearly 20 posts in length and I believe
could be satisfactorily completed if you would provide enough fields and
records with your desired calculations to thoroughly describe your needs.
I kinda expect that you want to maybe count unique values. I don't think you
have even stated anything like "I get a count value of 8 when I only have 2
departments".
--
Duane Hookom
MS Access MVP
LHEMA said:What sample are you looking for I have tried =count([Department]),
=Sum(IIf([Department]="1",[EmployeeID],0))
=IIf(Count([Department]) >=0))
=Sum(IIf([department]= "42200",1,0)
=Sum(nz([Department]))
For all these attempts I get and error in returned.
LHEMA
:
I don't see any sample records or how you would want to display these
with
your calculated totals in your report. Could you take the time to
manually
type a few records into a reply so that we can "see" what you want rather
than attempting to understand your description.
--
Duane Hookom
MS Access MVP
What I want is to total each department separately...right now employee
total
is working great using the expression =count([employeeID]) but how can
I
get
the department to do the same. Using this expression
=count([department])
does not count them separately it count them together. Now if I have a
employee that has to accident it counts that correctly but I have other
employees in that department that had an accident and I need to total
them
together. I hope I am making since.
--
LHEMA
:
I'm not sure what you want where at the moment. Your expression:
=nz(DLookUp("Department=1","[qry Employee Accident]"),0)
shouldn't result in anything useable. Where is this expression and
what
are
you attempting to calculate. If [qry Employee Accident] has more than
one
record, who knows which value it might return. Normally the first
argument
in DLookup() is not a true/false type expression.
--
Duane Hookom
MS Access MVP
Good morning, Duane
They are in a report footer and the employee total does work. I
think I
told
you it did not work. The dept total des not work, I have tried this
expression but it does not give me the numeric it gives me the name
of
the
deparment name:
=nz(DLookUp("Department=1","[qry Employee Accident]"),0) and using
this
expression it shows and error in employee total but ehn I take that
expression out employee total works
--
LHEMA
:
Did you place the new text boxes in a group or report footer
section?
I
can't imagine you would want them to appear anywhere else except
maybe
a
header section.
--
Duane Hookom
MS Access MVP
I have added 10 more records and the expression is use for
deparment:
=Count([Department]) and employee: =Count([EmployeeID]) and the
results
that i am getting is 1 for everybody
--
LHEMA
:
ok..I will let you know the results
--
LHEMA
:
Why don't you take the time to type in about 10-12 records to
show
us
exactly what you want in your report. This would save a whole
lot
of
guessing and only take you about a minute.
--
Duane Hookom
MS Access MVP
What I need to so count the number of employees that had an
accident
and
each
employee should have a separate report with the total of
accident
they
have
had. And for the department it should count only the
accidents
in
that
department not a all department. I use this expression and I
am
getting a
character for result what I mean is that I am getting the
name
of
the
Dept
and not the numeric number
=nz(DLookUp("Department","[qry Employee Accident]"),0)
=count([employeeID])
I hope I answer your question
--
LHEMA
:
Are you attempting to count the number of employees? What
field
needs to
be
Sum()'d?
--
Duane Hookom
MS Access MVP
I have been working on this for a while, I have restarted
my
database it
works fine. Now I need to get total for accident per
employee
and
the
total
for accident per departments. This is what I have done
thus
far, I
have
put a
footer on my report for each grouping employee total and
dept
total.
This
is
the expression that I am using =Sum([Department]) and for
employees
=Sum([EmployeeID]). Using this expression I get a
mismatch
data
type.
Any
help is appreciation.