I'm stuck can not get total sum correct

G

Guest

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.
 
G

Guest

I get a data mismatch when i try those two. I use this expression and I am
not getting a numeric answer here is the expression:
=nz(DLookUp("Department","[qry Employee Accident]"),0) the results from
this expression is the department number such as 42200 Road Dept
and and for employee total i use this expression: =Sum(nz([EmployeeID])) and
its giving me a total of the employeeID not a numeric value of 1 or 2. I have
3 reports and in each report I need a separate total for each employee. If
Robert had 3 accident in this department then I need to see in my report
employee total = 3 and department total =3 but if John gets 1 accident in the
road department I need to see on john report employee total=1 and department
total=4...I hope I am making since. Thank you

--
LHEMA


Crazyhorse said:
Try This =Sum(nz([Department]))
and =Sum(nz([EmployeeID]))


LHEMA said:
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.
 
D

Duane Hookom

Are you attempting to count the number of employees? What field needs to be
Sum()'d?
 
A

AccessVandal via AccessMonster.com

Department and EmployeeID are of text values, you can't add them.

Do something like,

Count([Department])
Count([EmployeeID])

I get a data mismatch when i try those two. I use this expression and I am
not getting a numeric answer here is the expression:
=nz(DLookUp("Department","[qry Employee Accident]"),0) the results from
this expression is the department number such as 42200 Road Dept
and and for employee total i use this expression: =Sum(nz([EmployeeID])) and
its giving me a total of the employeeID not a numeric value of 1 or 2. I have
3 reports and in each report I need a separate total for each employee. If
Robert had 3 accident in this department then I need to see in my report
employee total = 3 and department total =3 but if John gets 1 accident in the
road department I need to see on john report employee total=1 and department
total=4...I hope I am making since. Thank you
Try This =Sum(nz([Department]))
and =Sum(nz([EmployeeID]))
[quoted text clipped - 6 lines]
=Sum([EmployeeID]). Using this expression I get a mismatch data type. Any
help is appreciation.
 
G

Guest

Using those expression it counts all them I need for them to count each
department and employee separately on their report. If John have 2 accident
in the Road Dept I need to see on John report dept Total 2 and Empoyee
total=2 but if Steve get and accident in the Road Dept I need for Steve to
show on his report dept total =3 and employee total=1. Likewise with the
rest, the count for employees does not work at all I get zero for the result.

I use this function and I am getting character for my results not a numeric
answer
=nz(DLookUp("Department","[qry Employee Accident]"),0)


any help is appreciated
--
LHEMA


AccessVandal via AccessMonster.com said:
Department and EmployeeID are of text values, you can't add them.

Do something like,

Count([Department])
Count([EmployeeID])

I get a data mismatch when i try those two. I use this expression and I am
not getting a numeric answer here is the expression:
=nz(DLookUp("Department","[qry Employee Accident]"),0) the results from
this expression is the department number such as 42200 Road Dept
and and for employee total i use this expression: =Sum(nz([EmployeeID])) and
its giving me a total of the employeeID not a numeric value of 1 or 2. I have
3 reports and in each report I need a separate total for each employee. If
Robert had 3 accident in this department then I need to see in my report
employee total = 3 and department total =3 but if John gets 1 accident in the
road department I need to see on john report employee total=1 and department
total=4...I hope I am making since. Thank you
Try This =Sum(nz([Department]))
and =Sum(nz([EmployeeID]))
[quoted text clipped - 6 lines]
=Sum([EmployeeID]). Using this expression I get a mismatch data type. Any
help is appreciation.
 
G

Guest

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


Duane Hookom said:
Are you attempting to count the number of employees? What field needs to be
Sum()'d?

--
Duane Hookom
MS Access MVP

LHEMA said:
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.
 
D

Duane Hookom

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

LHEMA said:
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


Duane Hookom said:
Are you attempting to count the number of employees? What field needs to
be
Sum()'d?

--
Duane Hookom
MS Access MVP

LHEMA said:
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.
 
G

Guest

ok..I will let you know the results
--
LHEMA


Duane Hookom said:
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

LHEMA said:
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


Duane Hookom said:
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.
 
G

Guest

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


LHEMA said:
ok..I will let you know the results
--
LHEMA


Duane Hookom said:
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

LHEMA said:
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.
 
D

Duane Hookom

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

LHEMA said:
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


LHEMA said:
ok..I will let you know the results
--
LHEMA


Duane Hookom said:
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.
 
G

Guest

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


Duane Hookom said:
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

LHEMA said:
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


LHEMA said:
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.
 
D

Duane Hookom

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

LHEMA said:
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


Duane Hookom said:
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

LHEMA said:
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.
 
G

Guest

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


Duane Hookom said:
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

LHEMA said:
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


Duane Hookom said:
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.
 
D

Duane Hookom

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

LHEMA said:
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


Duane Hookom said:
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

LHEMA said:
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.
 
A

AccessVandal via AccessMonster.com

LHEMA said:
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.
I'm not sure what you want where at the moment. Your expression:
=nz(DLookUp("Department=1","[qry Employee Accident]"),0)
[quoted text clipped - 72 lines]

To count the by Department, you need to add a Group Footer for Department
and put "Count([Department]) into the new textbox.

By Grouping with this Footer, you can input your textbox to count.
Text1: =Count(Department]) Text2: =Count([EmployeeID])

The "=nz(DLookUp("Department=1","[qry Employee Accident]"),0)" does not
do any counting, all it does is to look up for a value.
 
G

Guest

I have =count([department]) and =count([employeeID]) in the footer but its
not returning the correct results for department. What I need is to count
each department separtely and what I mean is that frank has 2 accident in the
road dept. John has 1 so the total should be three. Hope this helps
--
LHEMA


AccessVandal via AccessMonster.com said:
LHEMA said:
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.
I'm not sure what you want where at the moment. Your expression:
=nz(DLookUp("Department=1","[qry Employee Accident]"),0)
[quoted text clipped - 72 lines]
Any
help is appreciation.

To count the by Department, you need to add a Group Footer for Department
and put "Count([Department]) into the new textbox.

By Grouping with this Footer, you can input your textbox to count.
Text1: =Count(Department]) Text2: =Count([EmployeeID])

The "=nz(DLookUp("Department=1","[qry Employee Accident]"),0)" does not
do any counting, all it does is to look up for a value.
 
G

Guest

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


Duane Hookom said:
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

LHEMA said:
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


Duane Hookom said:
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.
 
D

Duane Hookom

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


Duane Hookom said:
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

LHEMA said:
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.
 
G

Guest

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


Duane Hookom said:
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.
 

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

Top