0

How can I concatenate a datefield and a timefield?

I tried it with a formulafield and the code below, but it does n't work. Datefield (Format Date) / Timefield (Format Time). The flow runs fine, but the new datetime not appear in Salesforce.

DATETIMEVALUE(
TEXT(YEAR({!$Record.datefield__c}))
+ "-" +
TEXT(MONTH({!$Record.datefield__c}))
+ "-" +
TEXT(DAY({!$Record.datefield__c}))
+ " " +
{!$Record.timefield__c}
)
3
  • Is there a reason why you are using DATETIMEVALUE? Can you not use a formula of Data Type Text?
    – TSmith
    Commented May 18, 2021 at 19:36
  • I need the Datetimevalue because the field is necessary to add a event.
    – peXeq
    Commented May 19, 2021 at 7:27
  • Sp TEXT(YEAR(datefield__c)) & '-' & TEXT(MONTH(datefield__c)) & '-' & TEXT(DAY(datefield__c)) & ' ' & TEXT(timefield__c) would not work?
    – TSmith
    Commented May 20, 2021 at 10:06

1 Answer 1

0

I found the solution for summertime

(DATETIMEVALUE(TEXT(YEAR({!$Record.datefield__c}))&"-"&TEXT(MONTH({!$Record.datefield__c__c})) &"-" &TEXT(DAY({!$Record.datefield__c}))&" "&{!$Record.timefield__c}))-0.0833

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .