Hello Awesome Salesforce Developers ,
Few days ago, I got a requirement to calculate the elapsed time between Case open date and Case closed date.
There is standard formula of salesforce which will calculate the Date Difference (Field with datatype formula and return type text)
The above formula will calculate the difference in days, hours and minutes.
My requirement is to extend this formula to calculate the difference in days, hours, minutes and seconds.
Let's calculate it !!!
First will understand some factors about datetime.
1 Day = 24 Hours
24 Hours = 1440 Minutes
1440 Minutes = 86400 Seconds
Create a field with datatype formula and return type as Text. Use the below formula and you are set !!!!
FLOOR() - Used to round up to nearest integer.
ROUND() - Returns the nearest number to a number you specify.
Cheers !!!!
Few days ago, I got a requirement to calculate the elapsed time between Case open date and Case closed date.
There is standard formula of salesforce which will calculate the Date Difference (Field with datatype formula and return type text)
The above formula will calculate the difference in days, hours and minutes.
My requirement is to extend this formula to calculate the difference in days, hours, minutes and seconds.
Let's calculate it !!!
First will understand some factors about datetime.
1 Day = 24 Hours
24 Hours = 1440 Minutes
1440 Minutes = 86400 Seconds
Create a field with datatype formula and return type as Text. Use the below formula and you are set !!!!
ROUND() - Returns the nearest number to a number you specify.
Cheers !!!!
Nice...!!!!!
ReplyDeleteAwesome..!!!!!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIts really Helpful
ReplyDeleteGreat!!!!!!
ReplyDeleteNice really helpful..!!!
ReplyDeletewithout asking you just gave solution for issue at perfect time...it helped me a lot
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIm sorry got confused...I was calculating for the difference between today date and created date ....thanks
ReplyDeleteHi Sangeetha.. Comment above you is yours or not ?
DeleteHi Ajay i have the above comment which is not appropriate ...I have a query while calculating the difference between a date and now in terms of days hours minutes and seconds ...Is der any possibility that the formula field gets refreshed for seconds and minutes automatically in the record detail page (like we use rerender in visualforce)
DeleteHi Sangeetha.
DeleteIf we change any of date1 or date2 then formula will automatically refreshed else I don't think it will refreshed. You can check the consideration for formula field.