+ Start a Discussion
Coral RacingCoral Racing 

Date/Time Formula Help to Update a Custom Field?

Hello

I am trying to add a workflow rule to update a field when the time difference in hours between Date A - Date B is > than 2 hrs?

Any suggestions how I righ such a formula evaluation?

Many thanks

Sonya
Best Answer chosen by Coral Racing
logontokartiklogontokartik
Hi Sonya,
When you subtract the date fields it generally gives the result based on days, all you have do is get the right number, for 2 hrs its 0.08 part of the day. so you can do something like datefield1 - datefield2 > .08

Please see below for reference

https://help.salesforce.com/apex/HTViewHelpDoc?id=formula_using_date_datetime.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=formula_using_date_datetime.htm&language=en_US)
 

All Answers

logontokartiklogontokartik
Hi Sonya,
When you subtract the date fields it generally gives the result based on days, all you have do is get the right number, for 2 hrs its 0.08 part of the day. so you can do something like datefield1 - datefield2 > .08

Please see below for reference

https://help.salesforce.com/apex/HTViewHelpDoc?id=formula_using_date_datetime.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=formula_using_date_datetime.htm&language=en_US)
 
This was selected as the best answer
Coral RacingCoral Racing
Thank you -  i though 1t was something like that as 12 hrs is 0.5.