Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Location
    Maryland, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    report to count all 0.00 (Access 2000)

    I have a query that is doing some calculating. On my report I need to count all the 0.00 and I give to count all the totals that are more than 0.01. I tried going to the report header and put in =count [field name] and it gives me the whole total but when I but in =count =>0.01 [field name]. I think that i just do not have it in the right order

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: report to count all 0.00 (Access 2000)

    On the report, instead of using Count, try using DCount, which will give you the ability to define criteria for the records to be counted. The syntax is: DCount(expr, domain[, criteria]). You can get more details in Access Help.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Use a Sum to return a count

    There are (at least) two ways to accomplish this. One is, as ThomasW suggested, to use DCount. The other is most useful in a groupby query. In that situation, you create an expression that evaluates the condition you want to test and returns a true or false value (-1 or 0). Then you simply use a Sum on the expression. For example, You might create the following expression:

    Sum(Abs([field name]>=0.01))

    The inner expression will return a true or false, the Abs() function wll convert the -1 value to a positive value, and Sum will total all the values, giving the same effect as counting them.
    Charlotte

Posting Permissions

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