5 Replies Latest reply on Mar 10, 2010 3:59 PM by mau_1

# How to calculate the number of days between two dates

### Title

How to calculate the number of days between two dates

### Post

Im having troubles with this formula.

Im gynecologist and I am new with filemaker. I am using filemaker 10 on Mac OSX.

I have a field with a date called  Last menstrual period and another one called Week of Pregnancy

So how can I calculate the number of weeks and days between this dates? ( a normal length of a pregnancy  41weeks with 6 days )

for example. Last menstrual period 11/10/2009 (dd/mm/yyyy) , Weeks of pregnancy 21weeks with 3 days (calculate with the current day 10/03/2010)

And how can I get a date (field called Estimated date of delivery) from another date (Last menstrual period) adding 286 days . example 11/10/2009 (last menstrual period),  18/07/2010.

Thanks

• ###### 1. Re: How to calculate the number of days between two dates

1. Try:

Let (
d = Get (CurrentDate) - Last menstrual period
;
Div ( d ; 7 ) & " weeks with " &  Mod ( d ; 7 )
)

This calculation must be unstored.

2.

Last menstrual period + 286

• ###### 2. Re: How to calculate the number of days between two dates

Thanks for the quick reply!!! and for the interest!!! :)

the first formula doesnt work at all, because appears a lot of numbers

The second formula have the same problem because only add 286 to the years. example 2010....2296

• ###### 3. Re: How to calculate the number of days between two dates

Make sure the calculation result type is Text for the first formula, and Date for the second one.

• ###### 4. Re: How to calculate the number of days between two dates

And that Last menstrual period is a Date field to begin with.

• ###### 5. Re: How to calculate the number of days between two dates

Thanks very very much for your help!!!!!!!!!!!!!!!