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)?
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