### Title

Calc number of days between two dates

### Post

Let's say the date in the date field JOURNAL::date is 2011-08-26 for the current record, and 2011-06-23 for the same field for the previous record, then the result in the number field "dur" is giving me "73437" for the current record, and "73431" for the same field for the previous record. Why won't the "dur" number field give me the desired result of 64 days?

The JOURNAL table has a date field called JOURNAL::date.

In my LEDGER table layout, I have two fields used as I want to calculate the number of days betwen two dates.

I have a calculation field called "dur", result is number, to compute:

JOURNAL::date - durprev

I have a second calculation field called "durprev", result is date, to compute:

If( (Get(RecordNumber)-1) ≠ 0; GetNthRecord(JOURNAL::date;Get(RecordNumber)-1); 0)

I tried to follow the FileMaker Knowledge Base that has an example about calculating the number of days between two date fields and it seems pretty straight forward. But, I'm missing something.

Thanks for a beginner using FMPA 11v4 on Mac OS X Lion.