You need to sign in to do that
Don't have an account?
VSK98
Calculate the hours between two datetime fields
Hi All,
I have created the formula field for calculating the hours between two datetime fields ........But it not showing exact hrs......My Piece of code
I tried both .......bt i couldn't get it
Pls suggest me
ADV THNXS
VSK98
I have created the formula field for calculating the hours between two datetime fields ........But it not showing exact hrs......My Piece of code
TEXT(DATEVALUE (Closed) - DATEVALUE (Open)- 0.2916)
IF( Floor(DATEVALUE (closed)-DATEVALUE (open))*24)>9 (Floor((DATEVALUE (closed)-DATEVALUE (open))*24)), "0"& TEXT(Floor((DATEVALUE (closed)-DATEVALUE (open))*24)) )
I tried both .......bt i couldn't get it
Pls suggest me
ADV THNXS
VSK98
Please try the below formula:
Harsh Aditya
I've created a Text type formula and able to see the difference.
I took this case - Calculate the time difference between created record and lastmodified record.
Here is formula.
-Thanks
Ashlekh Gera
Thanks, great formula. Were you able to exclude weekends?
Cheers
Will
Thank you for help . (https://www.my-accountaccess.com/)
if yes then what will be the formula to calculate seconds and miliseconds.
Incorrect operator: In the IF statement, you're using a closing bracket ) after 24 instead of an opening bracket (. It should be Floor((DATEVALUE (closed)-DATEVALUE (open))*24) > 9.
Decimal subtraction: Subtracting a decimal value like 0.2916 from the result of DATEVALUE might not give you the accurate hour calculation. It's better to use the DATETIMEVALUE function to convert both datetime fields to a single datetime value and then perform the subtraction.
Here's an updated version of your code with the above changes: https://www.onecognizant.one/
Make sure the datetime fields Closed and Open are in the correct format and that the formula field is of the appropriate data type (e.g., Text).