Dcount

  • Thread starter Thread starter G
  • Start date Start date
G

G

Hi.
I am using Access 200. There is a particular column called SD in table tbl
A which has an option to choose Yes or No.
When i run the report (that is linked to a query) it will not successfully
count how many Yes and No result are in the report using Dcount function.
eg query is set up to first ask user to input Date from and Date To. Once
that is in place then the report produces all records with that date. At the
bottom of report (footer) i use a text box with the following control
source: =Dcount("[SD]"], "tbl A", "[SD]='Yes'")

I simply then counts all Yes data in table - disregarding the date period
parameter (ie date from and date to ) as mentioned earlier.
help.
 
G,

To get the desired outcome using DCount(), you would need to include the
same date selection criteria in the DCount expression as you have used
for the report itself. It will be simpler to use this instead...
=Sum(IIf([SD]="Yes",1,0))
or, more simply...
=Abs(Sum([SD]="Yes"))
 
Back
Top