Queries on multiple group levels

lioninwinter

New member
Local time
Today, 03:46
Joined
Apr 11, 2020
Messages
21
I have a simple table that lists Families, Dates, Event Type Role and Person - these are life cycle events associated with a small sample of families in a database to analyse historic families. I am interested in the intervals between events in each family specifically from the marriage to each baptism. The marriage is the earliest date for each family. I know how to calculate the difference between an individual event date and the minimum for the entire sample but I cannot work out how to calculate the event date and the minimum for each family. Can anyone help? It would be most appreciated!
 

Attachments

SQL:
SELECT
 A.Fam_Des,
  A.E_Date,
  A.ET_ID,
  [E_date]-(select minDate from qryMinDate where A.Fam_des = qryMinDate.fam_des) AS Diff
FROM tblExample AS A;
 
Thank you so much - I almost had it but missed out the square brackets on E_date. None of the books tell you!
 

Users who are viewing this thread

Back
Top Bottom