Howdy folks, I'm looking to create a query that does some calculations on my database.
Essentially, I'm trying to create a report for a hockey database that pulls all of the player names from one table, and then looks at another table to calculate the number of goals scored, etc.
I have no problem getting the list of players, but I'm not sure how to go about the second piece. I'm guessing I can create an expression within the query. Here's an example of the logic I'm trying to build in:
Total Goals:
Should look at the PlayerHistory table and bring back a count of the number of times the ActionType='Goal' was recorded for that particular player. (PlayerHistory has one unique row for each individual action that occurs in a game: goal, assist, etc.)
So, if PlayerHistory had 5 rows where Steve Battisti had an ActionType of 'Goal', then the query should return a '5'.
Any ideas?
Thanks!
Steve Battisti
Essentially, I'm trying to create a report for a hockey database that pulls all of the player names from one table, and then looks at another table to calculate the number of goals scored, etc.
I have no problem getting the list of players, but I'm not sure how to go about the second piece. I'm guessing I can create an expression within the query. Here's an example of the logic I'm trying to build in:
Total Goals:
Should look at the PlayerHistory table and bring back a count of the number of times the ActionType='Goal' was recorded for that particular player. (PlayerHistory has one unique row for each individual action that occurs in a game: goal, assist, etc.)
So, if PlayerHistory had 5 rows where Steve Battisti had an ActionType of 'Goal', then the query should return a '5'.
Any ideas?
Thanks!
Steve Battisti