Calculate time between related records
I have a Tests table with 3 fields:
- Test (specifies which test taken)
A particular student may take multiple different tests, and I need to calculate the time between their most recent test and the one prior. I've been trying the GetNthRecord function, but I can't figure out 2 things:
- I can pull the date from the previous record, but I cannot figure out how to write the calculation so that it returns the correct number. (For instance, if the previous test was on the same date, it should return a zero. It does not)
- The previous record is not always for the same student, and I want to calculate the difference in time between records of the same student.
Any help would be appreciated.