In-table relations (1 Viewer)

Noruen

New member
Local time
Today, 11:39
Joined
Jul 7, 2020
Messages
6
Hi guys,

is it possible and/or optimal from the point of relational database to have in-table relationships?

My issue:
I have Table called Car Logbook where I put mileages I have traveled. When i travel somewhere I always put total tachometer value (Tachometer End Mileages) and Distance into appropriate field together with Car ID, so my current design is like this:

TravelID​
Date​
CAR ID​
Distance​
Tachometer End Mileages​
#7.7.20201AH123450065536

My problem is, that distance can be calculated as difference between previous Tachometer End Mileages and thus Distance field is very prone to errors. The problem I have is, that I'm stuck with how to design this relationship "Current — Previous Travel". I thought it would be possible to add another field where I put ID of previous travel so there is clear relationship, but I cannot create this kind of query (Access do not let me to do it) and to manually insert TravelIDs is error-prone.

Do you have any suggestions about how to design this issue without unnecessary tables?

Many thanks!
 

bob fitz

AWF VIP
Local time
Today, 10:39
Joined
May 23, 2011
Messages
3,972
Noruen

Maybe something like:
 

Attachments

Noruen

New member
Local time
Today, 11:39
Joined
Jul 7, 2020
Messages
6
Thank you both! I will do some testing if this works for me (if I will be able to implement it). Much appreciated :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom