RotoGuru Computer Forum

View the Forum Registry


Self-edit this thread


0 Subject: For you MS Access Gurus

Posted by: JTSERB
- [36549922] Thu, Jun 10, 2004, 18:58

How would I go about creating a if then statement in a access database?

For example,

Say im keeping track of baseball scores. On the form I have the 2 teams names their respective scores then check boxes for the following:

Team 1 Shutout?
Team 2 Shutout?
Team 1 No hitter?
Team 2 No hitter?
Team 1 Perfect Game?
Team 2 Perfect Game?

Now when I run a report... How would I get it to say How many times the respective team has done one of those listed above?

Hope I explained it well enough.

Thanks


1Trip
      Donor
      ID: 13961611
      Fri, Jun 11, 2004, 13:01
For a table named "Teams" with 4 fields
- "Team Name" (text)
- "Shutout" (Yes/No)
- "NoHitter" (Yes/No)
- "PerfectGame" (Yes/No)

Here is the SQL View for the query.

SELECT Teams.[Team Name], Count(Teams.Shutout) AS CountOfShutout, Count(Teams.NoHitter) AS CountOfNoHitter, Count(Teams.PerfectGame) AS CountOfPerfectGame
FROM Teams
GROUP BY Teams.[Team Name]
HAVING (((Count(Teams.Shutout))=Yes) AND ((Count(Teams.NoHitter))=Yes) AND ((Count(Teams.PerfectGame))=Yes));
RotoGuru Computer Forum

View the Forum Registry


Self-edit this thread




Post a reply to this message: (But first, how about checking out this sponsor?)

Name:
Email:
Message:
Click here to create and insert a link
Ignore line feeds? no (typical)   yes (for HTML table input)


Viewing statistics for this thread
Period# Views# Users
Last hour11
Last 24 hours11
Last 7 days11
Last 30 days33
Since Mar 1, 2007629361