recording multiple session dates for regular clients

D

DGK

I have just started to create a database for a psychology practice. I am
trying to enter all relevant details including session dates. With the Client
Name as the primary key I am having trouble entering numerous session dates
as I am told that the primary key cannot have a null value. When I try to
address this by adding the client's name again I am not allowed to as there
is a duplication of the primary key.

What can I do?
 
T

TedMi

First, you should not be using client names as a key. John Roberts is Chief
Justice of the Supreme Court and co-host of CNN's daily program American
Morning. You need at least two tables for what you want:

Client Table:
ClientID Autonumber, Primary Key
FirstName Text
LastName Text
Address, Telnum, other info (referred by, insurance, etc.)
nothing about any sessions!

Session table:
SessionID Autonumber
ClientID Long Integer (nothing else about the client)
SessionDate Short date
Other info about the Session (eg. duration, topic, outcome)

Set a unique compound key on ClientID and SessionDate

But: IF a client can have more than one session per day, Use Long Date for
SessionDate and enter date & time for its value.

-TedMi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top