Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Adding a date and time together

VeronicaElse
8 - Asteroid

Can you add a date column and a time column together to create a new column as one?

10 REPLIES 10
JagdeeshN
12 - Quasar
12 - Quasar

Hi @VeronicaElse ,

 

If both these columns are of the string datatype currently, you can do a string concat using the formula tool. The formula would be 'Date_String'+" "+'TIme_String' . Post this you can DateTime parse tool to convert the string into a datetime datatype.

 

Do let me know if this helps.

 

Best,

Jagdeesh Narayanan

VeronicaElse
8 - Asteroid

Hello,

 

Thanks for replying!

 

I inputted the two fields into the formula provided (they were both VString) and added the DateTime parse tool to convert to datetime datatype and my output is NULL.

 

Any reasons why?

 

 

JagdeeshN
12 - Quasar
12 - Quasar

@VeronicaElse 

can you please share sample of the two strings you are using?

 

I ask so that i can get an idea of the format within the string.

afv2688
16 - Nebula
16 - Nebula

Hello @VeronicaElse ,

 

I'm leaving you here a small example, it might help you 🙂

 

Untitled.png

 

Regards

VeronicaElse
8 - Asteroid

here they are

VeronicaElse
8 - Asteroid

Thanks for the example--I am super nice to Alteryx so I am sure it is something I typed wrong. I still got NULL.

 

I copied what you did and for DATE I used the date of request and for TIME I used the time of the request---was that correct? those are the 2 I need to add together.

 

 

JagdeeshN
12 - Quasar
12 - Quasar

@VeronicaElse 

 

I am referring the format of the actual string. For eg. is the date string formatted as 12-12-2020 or 12/12/2020 or any other format. 

 

Similarly the format for the time string. I ask because you are getting the NULLS because of the format difference.

 

Best,

Jagdeesh

VeronicaElse
8 - Asteroid

date 2020/12/30  time 10:53:31

JagdeeshN
12 - Quasar
12 - Quasar

@VeronicaElse 

 

Please find attached a sample workflow which converts this format.

 

Do let me know if this helps.

 

Best,

Jagdeesh 

Labels