Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Subtracting hours from a date time and converting to date time.

IMTran
6 - Meteoroid

Hello,

 

I'm having trouble with my date time subtracting. I first imported by data and the DATETIME_D it is in the initial format of 10/16/2022 23:00  (I believe this would be M/d/yyyy HH:mm), but there are no leading zeroes in everything.

 

IMTran_0-1674762230437.png

 

To subtract 1 hour, I used this formula: datetimeadd([DATETIME_D],-1,"hours"), and I get errors like this :  Formula (28) DATETIMEADD: "10/17/2022 8:00" is not a valid DateTime

 

Am I missing something?

 

2 REPLIES 2
Felipe_Ribeir0
16 - Nebula

Hi @IMTran 

 

When you used the DateTime tool, you correctly transformed the DATETIME_D string to datetime, and the date is now inside of the Start column. So you need to apply the datetimeadd formula using the Start column as reference:

 

Felipe_Ribeir0_1-1674762959258.png

 

Felipe_Ribeir0_0-1674762815818.png

 

IMTran
6 - Meteoroid

Thank you very much for the help! This was a big oversight. Thank you for taking the time to help out. Hope you have a good day. 

Labels