I have a packaged application installed in my salesforce which sends the Service Duration
(Number Data Type) = 3,600.00 and another field Scheduled Date Time
12/21/2015 2:00 PM (DateTime Field Type).
I would like to calculate Service Duration + Scheduled Date Time
, so I can get the end of the scheduled date time.
I get an error because they are of two different data types; number and Date/time.
How can I convert the number "data type" field to an hr/mins and then add that to the Date
field .
Best Answer
When adding a
Decimal
to aDatetime
in a formula, it represents a number of days. If you want to add seconds, you just need to divide by the appropriate value.If the duration were in minutes:
Hours:
You also probably want to protect yourself against a
null
duration: