Percentage of time boolean field is true (1 Viewer)

Joshann

Registered User.
Local time
Today, 10:24
Joined
Mar 22, 2002
Messages
142
I would like to create a query that groups records and then tells me what percentage of the time a boolean field is true for each grouped field.

So in my table, there are multiple entries for each person. I want to find out what percentage of time each person won.

The table is called Races. The field to group on is called RunnerName. The boolean field that returns true if the Runner won and false if the Runner lost is RunnerW.

I have started by creating a query that groups on RunnerName. Now what?

I'm sure this isn't difficult, but I haven' worked with Access in a long time.

Thanks!
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:24
Joined
Sep 12, 2006
Messages
15,660
try a query that counts the races. add the Boolean winner flag to oyur query.

now each runner will be split into counts for winners and non-winners.

does that help?
 

Joshann

Registered User.
Local time
Today, 10:24
Joined
Mar 22, 2002
Messages
142
try a query that counts the races. add the Boolean winner flag to oyur query.

now each runner will be split into counts for winners and non-winners.

does that help?

Thanks, but no, not really. Now I have a query that shows me in the same column the number of wins and the number of losses for each runner, but I don't know how to get it to show me the percentage of time each runner won.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:24
Joined
Sep 12, 2006
Messages
15,660
well you can't directly.
you need at least two queries

have one query that counts the races by runner, another that counts the wins by runner.
now have a third query that left joins these two. now you can see the races and wins side by side, and get a percentage.
 

Joshann

Registered User.
Local time
Today, 10:24
Joined
Mar 22, 2002
Messages
142
well you can't directly.
you need at least two queries

have one query that counts the races by runner, another that counts the wins by runner.
now have a third query that left joins these two. now you can see the races and wins side by side, and get a percentage.

That worked. Thanks!!! I was thinking that there was a much easier way to do it.
 

Users who are viewing this thread

Top Bottom