function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SPowserSPowser 

DateDiff formula

Hello,

I am looking for a way to calculate the difference between two dates and enter that into a field using the Formula field type. I don't see anyway to do it yet. Is this possible?

Thanks,
SPowser
adamgadamg
{Date1}-{Date2} etc should work...
SPowserSPowser
Hehe, ok now I feel like a newb.
AJ yorkshireAJ yorkshire

I also needed this feature and played around with some formula fields. You can do {date1}-{date2} but it gives you an answer in (days point, decimal of a day).

Round(( {date1} - {date2} ),0) in one formukla field. Gives you the number of days

mod(({date1} - {date2 ),24) in another formula fieldwhich gave me in hours (However shows as 12.5 hours for 12.30)

But im sure with a little more maths this can be worked around. Dont know if this helps but its an idea

spazurespazure
I've got more variations on converting dates available on my blog:

http://www.ihatethebus.com/blog/index.php?entry=entry050831-144419
paul-lmipaul-lmi

i had to do this with datetime fields

 

 

On Case, I wanted number of hours since last modified

 

(Now() - LastModifiedDate)*24

 

Now() - LastModified gave me the differences in days, * 24 gave me that in hours.