C
Chris
I have a database that handles a racecar driver picks in
a friendly pool. Here is a query called Points that I
built from 2 tables called Picks and Finish. It displays
the Name, the race# , the driver picked and the finish of
that driver. There are over 30 races in the season. I am
trying to figure a way to modify or create a seperate
query to add up how many times a players(Name) picks
finishes in the top 5. I would like to name the column
TOP5 I also would like a column that tells me how many
times a player picks finishes in the top 10 called TOP 10.
The last thing I need is a column that tells me how many
times the status is not running called DNF.
I tried to do a crosstab query but it did not work right.
I have a sample of the query below.
Name RaceNo DriverId Finish Car Points Status
JESSE 1 Kevin Harvick 4 29 165 Running
MIDGE 1 Jimmie Johnson 5 48 160 Running
LC 1 Joe Nemechek 6 01 150 Running
AMBER 1 Elliott Sadler 7 38 146 Running
AL 1 Dale Jarrett 10 88 134 Running
JIM 1 Bobby Labonte 11 18 130 Running
JESSE 2 Matt Kenseth 1 17 190 Running
MIDGE 2 JamieMcMurray 3 42 170 Running
AMBER 2 Jamie McMurray 3 42 170 Running
JIM 2 Dale Jarrett 40 88 43 Engine
AL 2 Ryan Newman 6 12 155 Running
LC 2 Jeff Gordon 10 24 139 Running
JESSE 3 Kasey Kahne 2 9 175 Running
AL 3 Kasey Kahne 2 9 175 Running
AMBER 3 Kurt Busch 9 97 143 Running
JIM 3 Greg Biffle 40 16 43 Engine
MIDGE 3 Kurt Busch 9 97 143 Running
LC 4 Bobby Labonte 18 18 109 Running
JESSE 4 Tony Stewart 7 20 156 Running
AMBER 4 Tony Stewart 7 20 156 Running
LC 4 Casey Mears 34 41 66 Engine
JIM 4 Elliott Sadler 29 38 76 Running
MIDGE 4 Tony Stewart 7 20 156 Running
AL 4 Brian Vickers 21 25 100 Running
This is a small sample of what I would like my query to
look like.
Name Top 5 Top 10 DNF
Jesse 3 4 0
Midge 2 2 0
LC 0 2 1
I appreciate any help you can offer.
Thanks Chris
a friendly pool. Here is a query called Points that I
built from 2 tables called Picks and Finish. It displays
the Name, the race# , the driver picked and the finish of
that driver. There are over 30 races in the season. I am
trying to figure a way to modify or create a seperate
query to add up how many times a players(Name) picks
finishes in the top 5. I would like to name the column
TOP5 I also would like a column that tells me how many
times a player picks finishes in the top 10 called TOP 10.
The last thing I need is a column that tells me how many
times the status is not running called DNF.
I tried to do a crosstab query but it did not work right.
I have a sample of the query below.
Name RaceNo DriverId Finish Car Points Status
JESSE 1 Kevin Harvick 4 29 165 Running
MIDGE 1 Jimmie Johnson 5 48 160 Running
LC 1 Joe Nemechek 6 01 150 Running
AMBER 1 Elliott Sadler 7 38 146 Running
AL 1 Dale Jarrett 10 88 134 Running
JIM 1 Bobby Labonte 11 18 130 Running
JESSE 2 Matt Kenseth 1 17 190 Running
MIDGE 2 JamieMcMurray 3 42 170 Running
AMBER 2 Jamie McMurray 3 42 170 Running
JIM 2 Dale Jarrett 40 88 43 Engine
AL 2 Ryan Newman 6 12 155 Running
LC 2 Jeff Gordon 10 24 139 Running
JESSE 3 Kasey Kahne 2 9 175 Running
AL 3 Kasey Kahne 2 9 175 Running
AMBER 3 Kurt Busch 9 97 143 Running
JIM 3 Greg Biffle 40 16 43 Engine
MIDGE 3 Kurt Busch 9 97 143 Running
LC 4 Bobby Labonte 18 18 109 Running
JESSE 4 Tony Stewart 7 20 156 Running
AMBER 4 Tony Stewart 7 20 156 Running
LC 4 Casey Mears 34 41 66 Engine
JIM 4 Elliott Sadler 29 38 76 Running
MIDGE 4 Tony Stewart 7 20 156 Running
AL 4 Brian Vickers 21 25 100 Running
This is a small sample of what I would like my query to
look like.
Name Top 5 Top 10 DNF
Jesse 3 4 0
Midge 2 2 0
LC 0 2 1
I appreciate any help you can offer.
Thanks Chris