A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to count a value in a field



 
 
Thread Tools Display Modes
  #1  
Old July 6th, 2008, 10:36 PM posted to microsoft.public.access.queries
Dave
external usenet poster
 
Posts: 55
Default How to count a value in a field

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


  #2  
Old July 6th, 2008, 11:26 PM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default How to count a value in a field

On Sun, 6 Jul 2008 14:36:38 -0700, dave wrote:

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))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old July 7th, 2008, 12:37 AM posted to microsoft.public.access.queries
Dave
external usenet poster
 
Posts: 55
Default How to count a value in a field

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" wrote in message
. ..
On Sun, 6 Jul 2008 14:36:38 -0700, dave wrote:

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))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


  #4  
Old July 7th, 2008, 01:39 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 744
Default How to count a value in a field

On Jul 6, 6:37 pm, "dave" wrote:
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" wrote in message

. ..

On Sun, 6 Jul 2008 14:36:38 -0700, dave wrote:


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))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


put it in a summary section - not in the detail section.
  #5  
Old July 7th, 2008, 01:42 AM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default How to count a value in a field

On Sun, 6 Jul 2008 16:37:22 -0700, dave wrote:

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" wrote in message
. ..
On Sun, 6 Jul 2008 14:36:38 -0700, dave wrote:

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))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


Did you try it in the Report Footer?
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.