Alteryx Designer Desktop Discussions

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

Datetime format to Excel number format

amogha_cj
6 - Meteoroid

I want to convert Alteryx "datetime" format to MS-Excel "number" format

Example:

Alteryx: " 2019-07-21 12:30:00 " 

MS-Excel: " 43667.52 "

 

Kindly help me out in getting the result.

 

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @amogha_cj 

 

 

This should work:

 

Conversion DateTime.PNG

 

First the difference in days from Jan,01,1900 (that's how we get the Excel Number)

Then, the time difference in seconds so you can get the decimals.

 

DateTimeDiff([Field1],"1900-01-01 00:00:00", "days") +
(DateTimeDiff([Field1],DateTimeTrim([Field1],"day"),"seconds")/(60*60*24)) + 2

 

Cheers,

amogha_cj
6 - Meteoroid

Hi @Thableaus ,

 

Thanks alot!

Labels