You need to sign in to do that
Don't have an account?
sundhar.mks1.3962649227519546E12
How to calculate the Inbetween the "End Date and Time" and "Start Date and Time".
Hi,
I have a two date field "Start Date and time" and "End date and time" How to auto populate based on the difference between the "End Date and Time" and the "Start Date and Time" value populate to another one field? Kindly give any idea or give any example code
Thanks
I have a two date field "Start Date and time" and "End date and time" How to auto populate based on the difference between the "End Date and Time" and the "Start Date and Time" value populate to another one field? Kindly give any idea or give any example code
Thanks
Create a formula field Like below.
(End Date and Time - Start Date and Time)
it will return you number of days.
Check the below link for more information.
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
Create a formula field Like below.
(End Date and Time - Start Date and Time)
it will return you number of days.
Check the below link for more information.
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)
I have created formula field using following code. Two Date inbetween day/hour/minits populated to Job Time field
TEXT(FLOOR(End_Date_and_Time__c-Start_Date_and_Time__c)) & " Day(s), " & TEXT( FLOOR( MOD( (End_Date_and_Time__c-Start_Date_and_Time__c) * 24, 24 ) ) ) & " Hour(s) and " & TEXT( ROUND( MOD( (End_Date_and_Time__c-Start_Date_and_Time__c) * 24 * 60, 60 ), 0 ) ) & " Minute(s)"
Result:
Start Date and Time: 12/26/2014 3:31 AM
End Date and Time : 12/28/2014 3:37 AM
Job Time: 2 Day(s), 0 Hour(s) and 2 Minute(s)
Now Day(s)/Hour(s)/Minit(s) only update to another one field of "Time" I want to update the value separately like this.
Job Time: 2
Time: Day(s)
How to achive this requirement to Trigger,Kindly give any example
Thanks.
Refer the below link.
http://www.salesforce.com/us/developer/docs/dbcom_apex/Content/apex_methods_system_datetime.htm