Results 1 to 4 of 4
  1. #1
    Join Date
    May 2002
    Location
    wakefield, ri
    Posts
    35

    Unanswered: Counting in a report

    I would like to be able to count the number of records in a report that have a specific string in a field.

    My example is I have one field that has Checkout and Copy entries. In my report I have grouped Checkout and Copy, but I haven't figured out how to count the number of records. These Checkout and Copy groups are under a Project grouping in the hiearchy.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    If you already are grouping on these items then create a section footer for the category and add a text box control. set the data source to "= count([<name of control>])
    where <name of control> is a control in the report detail (it doesn't what it is)

  3. #3
    Join Date
    May 2002
    Location
    wakefield, ri
    Posts
    35

    Counting in a Report

    Thanks for the reply

    Both "checkout" and "copy" entries are in the same field and I have grouped on that field. It separates checkout and copy in the report, but I still haven't figured out how to count entries for each one individually.

    Is there a way to search for a string of text in the count statement?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you may have to resort to putting come code behind the report
    declare your global variables (eg SumCheckout, SumCopy)
    in the group header event zero your variables
    in the group detail event add to the variables
    eg if flag=checkout then sumcheckout=sumcheckout+myvalue else sumCopy=sumCopy+myvalue
    in the group format event load the contrls on the form
    eg
    txtSumCheckout=sumCheckout

    etc.....
    you can expand the totalling to include report totals & other group totals

    An alternative is to add a column to the source query which checks to see what type of value it is
    eg
    CheckOutVal:iif(<logical test to determine if its a checkout>,<value>,null)
    CopyValVal:iif(<logical test to determine if its a Copy>,<value>,null)
    this could instead be phrased as
    CheckOutVal:iif(<logical test to determine if its a checkout>,null,<value>)
    and report these fileds in the normal manner
    yer pays yer money, yer takes yer choice.....


    HTH

Posting Permissions

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