count only if criteria in another field is met

C

Camilady

Can I Count (the report footer) based on criteria in other fields,
sort of : count if [Team] = Trim and [Status ]= red
I have tried many different combinations to get this to work or do I need to
create queries for this . I have 15 different teams which could have one of
four different Status's
total neophyte would be grateful for suggestions
thanks
 
K

KARL DEWEY

Try this --
Sum(IIF([Team] = "Trim" And [Status] = "red", 1, 0)

Trim and red need to be in quotes as they are text. This evaluates team
and status and gives a value of 1 (one) if true and then sums the results.
 
C

Camilady

thanks for the quick answer - I did try this in the report footer, however
when I went to print preview I got an error message'Syntax error in query
expression'. I double checked the way I entered the formula and added an =
to the beginning and still got an error
 
K

KARL DEWEY

Post the SQL of the query for your report.

Camilady said:
thanks for the quick answer - I did try this in the report footer, however
when I went to print preview I got an error message'Syntax error in query
expression'. I double checked the way I entered the formula and added an =
to the beginning and still got an error

Camilady said:
Can I Count (the report footer) based on criteria in other fields,
sort of : count if [Team] = Trim and [Status ]= red
I have tried many different combinations to get this to work or do I need to
create queries for this . I have 15 different teams which could have one of
four different Status's
total neophyte would be grateful for suggestions
thanks
 
C

Camilady

Huh? , where would I find that?
KARL DEWEY said:
Post the SQL of the query for your report.

Camilady said:
thanks for the quick answer - I did try this in the report footer, however
when I went to print preview I got an error message'Syntax error in query
expression'. I double checked the way I entered the formula and added an =
to the beginning and still got an error

Camilady said:
Can I Count (the report footer) based on criteria in other fields,
sort of : count if [Team] = Trim and [Status ]= red
I have tried many different combinations to get this to work or do I need to
create queries for this . I have 15 different teams which could have one of
four different Status's
total neophyte would be grateful for suggestions
thanks
 
K

KARL DEWEY

I am assuming that your report is based on a query.
Open the query in design view, click on menu VIEW - SQL View. This opens
another window. Highlight, copy, and paste in a post.

Camilady said:
Huh? , where would I find that?
KARL DEWEY said:
Post the SQL of the query for your report.

Camilady said:
thanks for the quick answer - I did try this in the report footer, however
when I went to print preview I got an error message'Syntax error in query
expression'. I double checked the way I entered the formula and added an =
to the beginning and still got an error

:

Can I Count (the report footer) based on criteria in other fields,
sort of : count if [Team] = Trim and [Status ]= red
I have tried many different combinations to get this to work or do I need to
create queries for this . I have 15 different teams which could have one of
four different Status's
total neophyte would be grateful for suggestions
thanks
 
Top