Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Unanswered: Use Count in a Report

    I keep track of racing stats and need a little help with a report. In my report lists each driver's race results in his career. I use the Count to keep track of the number of Total races each driver has run. I want to also keep track of the number of Wins for each driver, but can't figure it out with Access. In Excel, I use Countif Function, but Access doesn't have this. Is there a way that I can use a Count Function, only if certain criteria is found (Such as Count all the races that the driver finished in 1st place)?

    Would appreciate any help.


  2. #2
    Join Date
    May 2004
    Moscow, Russia


    create source query for report with subqueries

    select drivername , iddriver, 
    (select count(*) from srctable as sub1 where sub1.iddriver = src.iddriver and  wincondition = true ) as countwins, 
    (select count(*) from srctable as sub2 where sub2.iddriver = src.iddriver ) as countraces
    from srctable as src

Posting Permissions

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