count only if criteria in another field is met

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

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

Back
Top