Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106

    Unanswered: conditional count in access report

    Hi,

    Hi,

    Trying to count the number of record in a report that has a certain value in a field and it counts all the record in the report. Is there a way to count do a conditional count in a report?

    A screen shot is attached to demonstrate what I am trying to do.

    Thanks
    Attached Files Attached Files
    Last edited by mkasem; 01-01-03 at 13:56.
    Mo

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    there are more ways...... you have easy report without grouping....

    1. add new column to your source query. This column holds your number only for Status = "L" MyField: IIF(Status = "L", MyValue,0)

    then SUM that field


    2. use DSUM function

    = DSUM("MyValue", "MySourceTable", "Status = " & chr(34) & "L" & chr(34))


    if you have special query for your report, you can use

    = DSUM("MyValue", reports("myReport").recordsource, "Status = " & chr(34) & "L" & chr(34))


    3. you can create variable in VBA and use IF statement.... this will take forever to run, but sometimes (in complicated report) it does it's job. In this case you have to understand how Access creates the report, cauze you could easily double count.



    jiri

Posting Permissions

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