• Counting in a report

    Author
    Topic
    #460497

    Hi, I have a query underpinning a report and want to do a count of instances of “yes” at a group level, the formula looks like this DCount(“[phonep]”,”qryDynamic_QBF2″,”[phoneP] = ‘Yes'”) on a textbox in my report on the specific group header. It returns the entire number of yes instances for the query and not the group. What am I doing wrong?

    Thanks, Darren.

    Viewing 1 reply thread
    Author
    Replies
    • #1164778

      Try this:

      =Abs(Sum([PhoneP]=”Yes”))

    • #1164779

      Hi, I have a query underpinning a report and want to do a count of instances of “yes” at a group level, the formula looks like this DCount(“[phonep]”,”qryDynamic_QBF2″,”[phoneP] = ‘Yes'”) on a textbox in my report on the specific group header. It returns the entire number of yes instances for the query and not the group. What am I doing wrong?

      You should always try to use the built-in Access methods for getting totals in a report (Sum, Count, etc.). In your case, I’m assuming [phoneP] is a string variable, so we could make the controlsource of the textbox in your group footer something like this:

      =Sum( IIF(phoneP=”Yes”,1,0) )

    Viewing 1 reply thread
    Reply To: Counting in a report

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: