Full Version: Different User Ids For Same Date, But Not Same User Id For Same Date
UtterAccess Discussion Forums > Microsoft® Access > Access Tables + Relationships
Heatshiver
I have two tables, a tblUsers and a tblDailyReport.

The tblUsers only stores a User ID. The tblDailyReport stores both the Date and the User ID. I have a relationship from tblUsers to the User ID on tblDailyReport. tblUsers has its primary key set to User ID. While tblDailyReport currently has no primary key.

When I use it this way I can have a User ID use more than one date. The issue here is that I can also have the User ID use the same date numerous times and have it stored in the tblDailyReport, creating multiple records for the same User ID and date.

If I make the Date in tblDailyReport a primary key, I can only use one User ID per date.

I need to ultimately have the same date but for different User IDs. However, I can't have duplicate records of the same date and User ID. What can I do to fix this?
theDBguy
Hi,

You can create a unique compound index based on both the UserID and Date field.

Just my 2 cents... 2cents.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.