how do i go about adding 2 fields together one has a DateTime data type (i.e - 2020-05-11 10:04:52) and the other field is a v_Wstring (i.e 01:14:26}. i get an error when i try to use the datetimeadd formula. Thanks
Solved! Go to Solution.
Hi @Chukwuma,
The DateTimeAdd function takes a date, adds a specified integer to it, and you specify "what" that integer is.
In your example, I would first isolate each of the time parts (so hour, minute, seconds). Then use them to calc total seconds. Then add the total seconds to your datetime. See attached for step-by-step.
Hi @Chukwuma,
You could use the DateTimeDiff() formula to convert the time to seconds and add it to your first datetime value:
DateTimeAdd([DateTimeValue],DateTimeDiff('2000-01-01 ' + [TimeValue],'2000-01-01','seconds'),'seconds')
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
Nice one @jdunkerley79 !!! Would've never thought of that!