Count Function

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hi all
In Access 2003 I am using the count function in a report in a text box
Form Footer to count the number of records displayed by a filter.
=count([VisitType]). This gives me a count of 11.
In the field VisitType I would like to just count the number of appearances
of BDN that appear in the total of 11
I have tried =count([VisitType])="BDN" and all sorts of variation but keep
getting errors. Can this be done?

Thanks in advance
 
Try:
=Sum(Abs([VisitType]="BDN"))

[VisitType]="BDN" will return -1 for true records and 0 for false records.
Abs() will convert -1 to 1.
Sum() will sum the expression.
 
Wow, what a brain. Thanks
Duane Hookom said:
Try:
=Sum(Abs([VisitType]="BDN"))

[VisitType]="BDN" will return -1 for true records and 0 for false records.
Abs() will convert -1 to 1.
Sum() will sum the expression.
--
Duane Hookom
MS Access MVP

Ken said:
Hi all
In Access 2003 I am using the count function in a report in a text box
Form Footer to count the number of records displayed by a filter.
=count([VisitType]). This gives me a count of 11.
In the field VisitType I would like to just count the number of
appearances
of BDN that appear in the total of 11
I have tried =count([VisitType])="BDN" and all sorts of variation but
keep
getting errors. Can this be done?

Thanks in advance
 

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