Count/Dcount and Group Header

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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'))
 
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.
 
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.
 
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.
 
Back
Top