You need to sign in to do that
Don't have an account?
Terry Jaeger
Adding Date/Time Fields
Hello Everyone,
I have a strange scenerio that I am not sure is possible. What I am trying to do is take a date/time field and a number field and get another date time field. So the use case is the client has a start date and time (date/time field) and a the duration (number field) the duration is the total hours worked. The idea is to get the end time from the start date and time and the duration. Now I if this does not work I may propose trying to use two date/time fields to get the duration. If that is easier what would the formula be for the duration field. Thank you for your help.
I have a strange scenerio that I am not sure is possible. What I am trying to do is take a date/time field and a number field and get another date time field. So the use case is the client has a start date and time (date/time field) and a the duration (number field) the duration is the total hours worked. The idea is to get the end time from the start date and time and the duration. Now I if this does not work I may propose trying to use two date/time fields to get the duration. If that is easier what would the formula be for the duration field. Thank you for your help.
you can try this:
create new formula field, return type Date/Time, and put in
start_date_and_time__c + (duration__c/24)
All Answers
If you want to keep it simple , then go for two Date time fields . one for Start time and other one for End time.
Two Datetime field
1. Start date - datetime field
2. End date - datetime field
3. Create a new formula field with return type as text and use this below formula.
TEXT( FLOOR( (Et__c - st__c) ) ) & " days "
& TEXT( FLOOR( MOD( (Et__c - st__c) * 24, 24 ) ) ) & " hours "
& TEXT( ROUND( MOD( (Et__c - st__c) * 24 * 60, 60 ), 0 ) ) & " minutes"
Your output will look something like this..
Here Et__c is end time and St__c is start time
Plz mark this as solution if it helps you :) Good luck Terry
you can try this:
create new formula field, return type Date/Time, and put in
start_date_and_time__c + (duration__c/24)