In-table relations (1 Viewer)

Noruen

Member
Local time
Today, 09:54
Joined
Jul 7, 2020
Messages
46
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, 08:54
Joined
May 23, 2011
Messages
4,717
Noruen

Maybe something like:
 

Attachments

  • Mileage01.accdb
    528 KB · Views: 118

Noruen

Member
Local time
Today, 09:54
Joined
Jul 7, 2020
Messages
46
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

Top Bottom