formula field to combine date and time into datetime?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a date field and a time field, and I'd like to combine them into a single ui-only datetime field with a formula, but I haven't gotten very far.

{{date}} & {{time}} isn't returning anything.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Matt,  can you tell me what kind of field that time field is?  Must not be standard salesforce, cuz they give you Date/Time fields...
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Yes. It's a string in the form "h:mm pm". Coming from a rest model.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Matt:   Javascript concatenation code is   "+"   not &.    Such a little thing. 

The formula  {{CloseDate}} + {{Name}} worked fine for me. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Arg! Thanks, Rob.