Use each record of table A as field of table B in access

66 Views Asked by At

I'm trying to figure out maybe a simple problem. I need to create a kind of attendance tracker and use as field of one table, records from another one.

Example:

TABLE A WHERE I HAVE ALL NAMES OF USERS

NAME INFO
Name 1 detail 1
Name 2 detail 2

TABLE B WHERE I STORE FOR EVERY DAY WHO IS THERE OR NOT

DATE Name 1 Name 2 Name [...]
01/01/2024 YES YES ----------
02/01/2024 NO YES ----------

I mean, I don't know if this can be possible using access or not, I've already done with the table A imported from excel but I really can't find a solution to generate as many fields as the records of the first table

2

There are 2 best solutions below

2
Burunduque On

Step 1. Transpose table B

Date (id) Names Presence
01.01.2024 Name1 Yes
01.01.2024 Name2 Yes
01.01.2024 ... ...
01.02.2024 Name1 No
01.02.2024 Name2 Yes
... ... ...

Step 2. Let's remove redundancy. Let's leave only those who were present

Date (id) Names Presence
01.01.2024 Name1 Yes
01.01.2024 Name2 Yes
01.01.2024 ... ...
01.02.2024 Name2 Yes
... ... ...

Step 3. column "Presence" is no longer needed. We indicate the names of only those who were present

Date (id) Names
01.01.2024 Name1
01.01.2024 Name2
01.01.2024 ...
01.02.2024 Name2
... ...
1
lukasmaska98 On

Your design is not normalized..

Table B - attendance:

DATE USER_ID
01/01/24 1
01/01/24 2

This saves a lot of space, avoids redundancy, etc..