Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 3rd, 2003, 11:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: South Bend, Indiana, USA.
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to count a record when it is not there

I keep the stats for my high school hockey team that I coach, and I enter the score sheet data into my database and then print reports. Everything worked fine execpt that I noticed our Won/Loss record was incorrect. When I looked into it I found that it was because in the games where one team did not score that game did not get counted.

I have the header table:
PH_SCORE_HEADER
     StatID
     Home (team number/ID)
     Visitor (team number/ID)
     GameDate

and the detail table:
PH_SCORE_DETAIL
     StatID
     Team (team number/ID)
     Scorer (player number/ID)

Basically I was counting all of the entries in the detail tabel, per game, for both the home team and the visiting team matching up the StatID, but if they did not score there was no entry in the detail for one or both teams, then my query was wrong.

Anyone have a way of making this work or do I have to resort to putting 2 more fields in the header table to keep track of the final score fo the game? I know there is enough information in the tables to make this work, but I can't seem to understand the logic or figure out the query to make it work to give me the scores for each game based on the detial entries so that I can produce the won/loss record correctly.

Thanks for your help.
__________________
Mitch
Reply With Quote
  #2 (permalink)  
Old October 3rd, 2003, 03:49 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please show your code that you are using on your query. It sounds like you arehaving a problem with a join clause.
Sal

Sal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
record count help jpaul VB Databases Basics 2 January 22nd, 2008 02:49 PM
count no of record sanjeev jha ADO.NET 1 November 5th, 2007 12:28 PM
Record count deb1980 ASP.NET 2.0 Basics 6 April 10th, 2007 12:42 PM
Count Record prasanta2expert Access 3 November 28th, 2006 10:42 AM



All times are GMT -4. The time now is 12:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.