Hi all,
I have this data and I want to add the (duration in Mins) to the time on the first column.
I tried many ways but couldn't do it. One of them is using the following function but it's not working:
Any advice on what's the best way, hopefully easy one?
Solved! Go to Solution.
Hello @Maltaleb001 ,
Thats an interesting question. Would like to know if there is a better way than this one:
DateTimeAdd([Field1],DateTimeSeconds([Field2])+60*DateTimeMinutes([Field2])+DateTimeHour([Field2])*3600, 'seconds')
Here I am transforming the time into seconds
Hope it helps
Regards
You need to convert the time to a number field with the total number of minutes or seconds to add on in order to use DateTimeAdd. See a couple of solutions on this thread:
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Adding-Times-Together/td-p/8658
Hi @Maltaleb001,
I decided to use three separate formulas to add on the hours, minutes and seconds
DateTimeAdd([DateTime],DateTimeHour(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'hour')
DateTimeAdd([DateTime],DateTimeMinutes(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'minute')
DateTimeAdd([DateTime],DateTimeSeconds(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'seconds')
I've attached my workflow for you to download if needed!
Kind regards,
Jonathan