function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
R ReayR Reay 

Creating formula with Date/Time output through combining a Date and Time field in SF

Hello,

I want to create a formula to use within a flow that outputs a DATETIME value using seperate inputs from a Date field and Time field. 

I have tried various different formulas, but have yet to get it working. For reference, I have been playing around with formulas such as:

DATETIMEVALUE ( TEXT ( DATEFIELD__c) & " " & (TIMEFIELD__c))

However, none have worked thus far. Appreciate any insight or guidance on this one.

Thank you,

R
Maharajan CMaharajan C
Hi Reay,

Please try the below formula:
 
(DATETIMEVALUE(TEXT(YEAR(DATEFIELD__c)) +"-" +TEXT(MONTH(DATEFIELD__c)) +"-" +TEXT(DAY(DATEFIELD__c)) +" " + TEXT(VALUE(LEFT(TEXT(TIMEFIELD__c), 2))) + MID(TEXT(TIMEFIELD__c),3,3) +":00"))

Thanks,
Maharajan.C
AnkaiahAnkaiah (Salesforce Developers) 
Hi Reay,

try with below formula.
DATETIMEVALUE(TEXT(MONTH(DATEFIELD__c)) +
"/" +TEXT(DAY(DATEFIELD__c)) +
"/" +TEXT(YEAR(DATEFIELD__c)) +" " 
+ TEXT(VALUE(LEFT(TEXT(TIMEFIELD__c), 2))) + MID(TEXT(TIMEFIELD__c),3,3) +":00")

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​
Prateek Prasoon 25Prateek Prasoon 25
 Hey, Reay 
   
You can use this formula :
 
(DATETIMEVALUE(TEXT(YEAR(DATEFIELD__c)) + ":" +
TEXT(MONTH(DATEFIELD__c)) +":"+
TEXT(DAY(DATEFIELD__c)) + " :" +
TEXT(VALUE(LEFT(TEXT(TIMEFIELD__c), 2))) + MID(TEXT(TIMEFIELD__c),3,3) +":00"))


Kindly mark it as the best answer if it helps .
 
anglina voltan 19anglina voltan 19
CVS is one of the largest drugstore chains in the United States that provides high-quality healthcare and wellness solutions. let's check here : cvssurvey