Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query

Status
Not open for further replies.

StevePalmer1

Technical User
Feb 22, 2007
1
GB
Hello,

I have a very simple database for recording attendence to classes

Table 'Player'
PlayerID AutoNumber
FirstName Text
LastName Text
...

Table 'Class'
Class AutoNumber
Date Date/Time

Table 'Player Attendence'
PlayerAttendence AutoNumber
Attended Yes/No
Class Number
Player Number

'Player Attendence'.Class and 'Player Attendence'.Player are foreign keys to the Class and Player tables.

I have the following query:

SELECT Player.FirstName, Player.LastName, [Player Attendence].Attended, Player.[Class Type], [Player Attendence].Class
FROM Player LEFT JOIN [Player Attendence] ON Player.PlayerID = [Player Attendence].Player
WHERE (((Player.[Class Type])=1));

What I would like is to default [Player Attendence].Class to the max value in the table Class i.e

SELECT Max(Class.Class)
FROM Class;

In this way to record attendance to a class the user would add a new entry to the 'Class' table and then fire the modified query. Is this possible? As you can see I am new to access to please excuse if I am missing the obvious.

Thanks
 
Something like this ?
Nz([Player Attendence].Class, DMax("Class","Class"))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top