- #1
Melbourne Guy
- 462
- 315
- TL;DR Summary
- I'm using the latest version of Access on Windows 10 and want to calculate age from a date of birth field in one table and an event date in another and it's not working ☹
Having exceeded the limits of Excel to track the names, rank, attributes, etc. of a list of ship's crew, I have tried to use Access.
First up...
I'm not a database expert. So, I'm muddling along with help from YouTube, but either I can't frame a correct search for this problem or it's not commonly asked and so I'm stuck. Basically, what I want to do is calculate the age of crew by taking the date of a known event in one table, and their date of birth in another, and subtracting the years.
The two tables are:
- Timeline, which has one entry of 'date' type.
- Crew, which has one entry with multiple attributes that include DOB of 'date' type.
As a test, in the 'Crew' table I have used the Year() function to confirm that I can access the DOB field and that the correct year of birth is extracted. However, when I try and create a calculate relationship that uses the Year() function from the Timeline table, it returns the wrong value:
I have reached the limit of attaching screenshots, but the Wizrad results in an 'Event_Date' field in the Crew table that shows the correct 1970 date. But if I now apply the Year() calculation to the 'Event_Date' field, it results in the number 1899.
It is not obvious what I am doing wrong, but any thoughts would be appreciated!
First up...
I'm not a database expert. So, I'm muddling along with help from YouTube, but either I can't frame a correct search for this problem or it's not commonly asked and so I'm stuck. Basically, what I want to do is calculate the age of crew by taking the date of a known event in one table, and their date of birth in another, and subtracting the years.
The two tables are:
- Timeline, which has one entry of 'date' type.
- Crew, which has one entry with multiple attributes that include DOB of 'date' type.
As a test, in the 'Crew' table I have used the Year() function to confirm that I can access the DOB field and that the correct year of birth is extracted. However, when I try and create a calculate relationship that uses the Year() function from the Timeline table, it returns the wrong value:
I have reached the limit of attaching screenshots, but the Wizrad results in an 'Event_Date' field in the Crew table that shows the correct 1970 date. But if I now apply the Year() calculation to the 'Event_Date' field, it results in the number 1899.
It is not obvious what I am doing wrong, but any thoughts would be appreciated!