How to count a value in a field

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

Access 2003

I am trying to run a query for a report.

One of the fields I need to report on is an "Option" field with 3 options.

How can I get a count of all of each Option?

There are several other fields on in the query with criteria

Thanks in advance,

dave
 
Access 2003

I am trying to run a query for a report.

One of the fields I need to report on is an "Option" field with 3 options.

How can I get a count of all of each Option?

There are several other fields on in the query with criteria

Thanks in advance,

dave

I would do this in the report itself.
Use 3 unbound text controls placed anywhere in the report EXCEPT in
the Page Header or Page Footer sections:

=Sum(IIf([OptionName] = 1,1,0))
=Sum(IIf([OptionName] = 2,1,0))
=Sum(IIf([OptionName] = 3,1,0))
 
Thanks for the reply.
If I do it this way - how do I keep the option field from repeating for
every record (I only need a total - not each record)

dave

fredg said:
Access 2003

I am trying to run a query for a report.

One of the fields I need to report on is an "Option" field with 3
options.

How can I get a count of all of each Option?

There are several other fields on in the query with criteria

Thanks in advance,

dave

I would do this in the report itself.
Use 3 unbound text controls placed anywhere in the report EXCEPT in
the Page Header or Page Footer sections:

=Sum(IIf([OptionName] = 1,1,0))
=Sum(IIf([OptionName] = 2,1,0))
=Sum(IIf([OptionName] = 3,1,0))
 
Thanks for the reply.
If I do it this way - how do I keep the option field from repeating for
every record (I only need a total - not each record)

dave


I would do this in the report itself.
Use 3 unbound text controls placed anywhere in the report EXCEPT in
the Page Header or Page Footer sections:
=Sum(IIf([OptionName] = 1,1,0))
=Sum(IIf([OptionName] = 2,1,0))
=Sum(IIf([OptionName] = 3,1,0))

put it in a summary section - not in the detail section.
 
Thanks for the reply.
If I do it this way - how do I keep the option field from repeating for
every record (I only need a total - not each record)

dave

fredg said:
Access 2003

I am trying to run a query for a report.

One of the fields I need to report on is an "Option" field with 3
options.

How can I get a count of all of each Option?

There are several other fields on in the query with criteria

Thanks in advance,

dave

I would do this in the report itself.
Use 3 unbound text controls placed anywhere in the report EXCEPT in
the Page Header or Page Footer sections:

=Sum(IIf([OptionName] = 1,1,0))
=Sum(IIf([OptionName] = 2,1,0))
=Sum(IIf([OptionName] = 3,1,0))

Did you try it in the Report Footer?
 
Back
Top