+ Start a Discussion

Help combining a "date field" and "Time Field" into a date/time field


We have 2 fields populating from a third party system

tour_date__c and tour_time__c

at the moment the tour_time__c field is a picklist for reporting purposes but it doesnt have to beit can be text if need be.  

I want to combine the tour_date__c and tour_time__c field into one "tour_date_time__c" field either with a formula field or with a field update.  Field Update would be better but either would work.

tour_time__c = 10:00 PM
tour_date__c = 7/4/2015

Formual or Field Update 
tour_date_time__c = 7/4/2015 10:100 PM.

I also am in PST (GMT - 7) which i think matters

Let me know if you have any questions and thank in advance for any help


Prabhat Kumar12Prabhat Kumar12
By using formula you can concatinate the field values.

text(tour_date__c) & " " & Text(tour_time__c)

Mark this as answer if it works for u.
William TranWilliam Tran
it depends on what type of fields they are:

tour_date__c is text or Date
tour_time__c is text or Date/Time (Salesforce does not really have a TIme object as a custom field)
tour_date_time__c is text or Date/Time

tour_date__c = Date Field
tour_time__c = Picklist (but could be a text field if it makes it eaiser)
tour_date_time__c = Date/Time Field
William TranWilliam Tran

If you still need this, try this: DATETIMEVALUE(TEXT(the date) + 'TEXT(the time))

so it should be: 

      DATETIMEVALUE(TEXT(tour_date__c ) + tour_time__c)

or if tour_time__c is picklist then

      DATETIMEVALUE(TEXT(tour_date__c ) + TEXT(tour_time__c))

Pedro AldanaPedro Aldana
Try this
DATETIMEVALUE( TEXT(Date field)&' '& LEFT(TEXT( Time field ), 8) )