Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6962 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi

I would like to substrack two dates and get the result in number. Something like 04/01/2006 - 01/01/2006 = 4

Thanks

Posted

Hi

the two dates are into two date fields ?

If so, the calc is: date2 - date1 + 1

or, if you don't know wich is the greatest:

Abs(date2 - date1) + 1

Posted

Hi

I would like to substrack two dates and get the result in number. Something like 04/01/2006 - 01/01/2006 = 4

Thanks

Well, you can create a calculation field whose result is a Number and basically use the equation you wrote. Assuming the dates are in two fields it would be as simple as:

Date2 - Date1

However, this will return the number of days not the number of months as it appears that you are looking for. You could then try:

Truncate((date2 - date1)/30,0)

This basically takes the number of days between the two dates and divides it by an estimated number of days per month. Then, the Truncate function just drops the numbers to the right of the decimel. You could leave the Truncate function of if you want the exact number of months.

It should be noted though that using the above calculation using the two dates that you used in your post would not return 4. It would return 3.

Posted

I think that Bikerman17 is using the format:

DDMMYYYY (international)

Isn't so, Bikerman ?

That would explain it. Sorry. I was looking at it from a U.S. perspective. Either way though, you would have add 1 to the result like Daniele did in an earlier post.

Posted

I try to substract the current day which is a calc and a date field. I end up with a weird result.

Please, give us an example of those "weird result"

Posted

Please, check your fields definitions...

date1 must be a date

date2 must be a calc (result date) = GetCurrentDate

Difference must be a calculation (result number)

Posted

Perhaps I am missing something, attach a sample to your next reply. I'd like to see that in detail.

Posted

Basically, that's what I did but in my file the result is 87. I pasted your calc and got the same result. My date format is DDMMYYYY but I never encountered any limitations in dealing with date string calculations. Anyway I manage to use your file in relationship with another one.

Thank you

This topic is 6962 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.