Count/Dcount and Group Header

G

Guest

I have a report which has a group header based on dates. For each date (~60)
I need specific information. One of the pieces of info I need to display is
the number of records where the "port" field is Y or N.

In the group header if I use DCount, I get the number of records in the
entire table fitting the request. I have not been able to use Count in this
format = Count([port]='Y').

How can I get the number of records for each date which has an entry for the
field of either Y or N. These are text values. I also need to display in the
same group header the number of unique order numbers.

As always, your help is appreciated.
 
G

Guest

Try something like

=Sum([port]='Y',1,0).

So it will sum all the 1'ns when the criteria is met

Or,
Sum(Abs([port]='Y'))
 
G

Guest

Hi!

Thank you! The second example worked perfectly!

Ofer Cohen said:
Try something like

=Sum([port]='Y',1,0).

So it will sum all the 1'ns when the criteria is met

Or,
Sum(Abs([port]='Y'))

--
Good Luck
BS"D


Danu said:
I have a report which has a group header based on dates. For each date (~60)
I need specific information. One of the pieces of info I need to display is
the number of records where the "port" field is Y or N.

In the group header if I use DCount, I get the number of records in the
entire table fitting the request. I have not been able to use Count in this
format = Count([port]='Y').

How can I get the number of records for each date which has an entry for the
field of either Y or N. These are text values. I also need to display in the
same group header the number of unique order numbers.

As always, your help is appreciated.
 
O

Ofer Cohen

Ooops, my mistake with the first example, I forgot the IIf.

Should be:
=Sum(IIf([port]='Y',1,0))

----
Good Luck
BS"D

Danu said:
Hi!

Thank you! The second example worked perfectly!

Ofer Cohen said:
Try something like

=Sum([port]='Y',1,0).

So it will sum all the 1'ns when the criteria is met

Or,
Sum(Abs([port]='Y'))

--
Good Luck
BS"D


Danu said:
I have a report which has a group header based on dates. For each date (~60)
I need specific information. One of the pieces of info I need to display is
the number of records where the "port" field is Y or N.

In the group header if I use DCount, I get the number of records in the
entire table fitting the request. I have not been able to use Count in this
format = Count([port]='Y').

How can I get the number of records for each date which has an entry for the
field of either Y or N. These are text values. I also need to display in the
same group header the number of unique order numbers.

As always, your help is appreciated.
 
G

Guest

I'll try that one as well. These are both good to know about for these
situations. Again, thank you!

Ofer Cohen said:
Ooops, my mistake with the first example, I forgot the IIf.

Should be:
=Sum(IIf([port]='Y',1,0))

----
Good Luck
BS"D

Danu said:
Hi!

Thank you! The second example worked perfectly!

Ofer Cohen said:
Try something like

=Sum([port]='Y',1,0).

So it will sum all the 1'ns when the criteria is met

Or,
Sum(Abs([port]='Y'))

--
Good Luck
BS"D


:

I have a report which has a group header based on dates. For each date (~60)
I need specific information. One of the pieces of info I need to display is
the number of records where the "port" field is Y or N.

In the group header if I use DCount, I get the number of records in the
entire table fitting the request. I have not been able to use Count in this
format = Count([port]='Y').

How can I get the number of records for each date which has an entry for the
field of either Y or N. These are text values. I also need to display in the
same group header the number of unique order numbers.

As always, your help is appreciated.
 

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