Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reports and dcount (2000)

    Hello, have a field that I wish to do a dcount on thus =DCount("[band]","qryBandRelations","[Goal Achieved?] = -1"). This is fine in the footer, it counts all as expected to give a total being 14, when applying same syntax to my field in the header, each band returns the total number,i.e. imagine Band A , B C then the count for each showing as the total 14, 14, 14. These band A, B and C should have different figures totalling 14. What must I do to get the header reading correctly?

    Thanks.

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

    Re: reports and dcount (2000)

    DCount, DSum etc. are different from their counterparts Count, Sum etc.
    DCount by itself knows nothing about the grouping in your report, and you don't tell it anything specific about your report either. Is qryBandRelations the record source of the report? If so, you could use

    =Abs(Sum([Goal Achieved?] = -1))

    to count the records in each band. Alternatively, you could use

    =DCount("*","qryBandRelations","[Goal Achieved?] = -1 And [Band] =" & Chr(34) & [Band] & Chr(34)).

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reports and dcount (2000)

    Thank you again Hans, I will try this tomorrow. If I don't reply please take it that it has worked.

    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
  •