# [Period] field calculation

#### RSZ-EC

##### Member
Hi everybody!

As I'm the first here and this is the first post I should congratulate the authors for this great software!

Now to my problem: When I use 'Period' field in an object to calculate the age of a person, the result I get is useful for me, because I only need years and months. But when I need to calculate the amount of days between two specific dates for specific uses (for example medical or legal certifications), I need that the 'Period' field includes the initial day in the calculation. So, if I choose a period from 01/01/2019 to 02/01/2019 (dd/mm/yyyy format) the result should return "2 days" instead of "1 day".

Is there a way to select this behavior in 'Period' field? Or a workaround for this?

In the meantime, I'm using A LOT of "[String([Period]=n day?n + 1 days: )] formulas in a 'Composite' field that check a 'Period field', and according to the result, returns a specific value. But it's not an elegant solution and only checks the amount of formulas I put in the field. For only 30 days is EXTREMELY long.

What can I do?

#### Anti

Staff member
Hello, RSZ-EC! We are glad to welcome you here. Thank you for using our product.

Do you know about the possibility to get the difference between two dates in days using the 'Calculation' field? In this case, you can use formula like `[Date2]-[Date1]+1` to add the initial day in the result.
In this case, there is no need to use the 'Composite' field with many String functions in the formula (if the Composite field was needed only to add 1 day to the result of the Period, correct it if this is not the case).

In the future (most likely, in version 6.1), we will add a property for the Period field, which will add 1 day if necessary.

#### RSZ-EC

##### Member

Do you know about the possibility to get the difference between two dates in days using the 'Calculation' field? In this case, you can use formula like [Date2]-[Date1]+1 to add the initial day in the result.
I'm afraid 'Calculation' field doesn't work. I put this formula to it, pointing to two 'Date' fileds and always returns '1'.

Please see `Period.jpg`

if the Composite field was needed only to add 1 day to the result of the Period, correct it if this is not the case
You are correct. I only need add 1 to the result of 'Period' field,

In the future (most likely, in version 6.1), we will add a property for the Period field, which will add 1 day if necessary. Last edited by a moderator:

#### Anti

Staff member
I'm afraid 'Calculation' field doesn't work. I put this formula to it, pointing to two 'Date' fileds and always returns '1'
This is a bug, due to the fact that we use a different date format by default. We will fix this in the next 5 and 6 version updates.

#### RSZ-EC

##### Member
Thank you. I truly hope that fix!