January 5, 200620 yr Hi I would like to substrack two dates and get the result in number. Something like 04/01/2006 - 01/01/2006 = 4 Thanks
January 5, 200620 yr 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
January 5, 200620 yr Author I try to substract the current day which is a calc and a date field. I end up with a weird result.
January 5, 200620 yr 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.
January 5, 200620 yr I think that Bikerman17 is using the format: DDMMYYYY (international) Isn't so, Bikerman ?
January 5, 200620 yr 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.
January 5, 200620 yr 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"
January 5, 200620 yr Author Yes I am using the internationnal format but it doesn't matter. I got -86.
January 5, 200620 yr 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)
January 5, 200620 yr Author Perhaps I am missing something, attach a sample to your next reply. I'd like to see that in detail.
January 5, 200620 yr Here it is ! P.S. I have added some "case" statement, so if the date is empty, the calc don't evaluate. DateDifference.zip
January 5, 200620 yr Author 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
Create an account or sign in to comment