Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try this:

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

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    [quote name='iksotof' post='779859' date='15-Jun-2009 07:39']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?[/quote]
    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) )
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you gents, both work well.

    Much appreciated, Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •