Alteryx Designer Desktop Discussions

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

Request help removing "00:00:00" from Date field

Archaeopteryx
10 - Fireball

Hi,

 

I have this formula:

 

DateTimeTrim(DatetimeAdd([Create Date],1,"month"),"day")

 

I'm adding 1 month to the date in [Create Date] << a home made field, and would like the "00:00:00" removed. I thought the DateTimeTrim() would do that with the parameter "day", but it's not removing the zeros. 

 

Thanks in advance, 

Chris

8 REPLIES 8
Lwt08
6 - Meteoroid

The DateTimeTrim function will basically round the datetime down to the unit you want. i.e. day trims time to 00:00:00 regardless of what it was previously. I recommend either using datetimeformat to just format out the time or a regex_replace function call of " .*", "" assuming your date is not separated by spaces.

estherb47
15 - Aurora
15 - Aurora

Hi @Archaeopteryx 

 

The Formula tool can't change the data type of an existing field. But, you can create a new field with a data type of Date, and then the time piece should fall away.

 

Let me know if that helps.

 

Cheers,

Esther

grazitti_sapna
17 - Castor

Hi @Archaeoptryx,

 

Try using this formula.

Thanks.

Date_time_format.PNG 

Sapna Gupta
MarqueeCrew
20 - Arcturus
20 - Arcturus
Or ... use a select tool and change the type to DATE.

cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Archaeopteryx
10 - Fireball

Hi EstherB47, 

 

 

Archaeopteryx
10 - Fireball

Hi grazitti_sapna

 

My result is null when I use this formula. Let me break down my components.

 

The formula is named [Create Date plus a month]

DateTimeFormat(DatetimeAdd([Create Date],1,"month"),"%B %d, %Y"), its type is Date. I'm using the format "%B %d%Y".

 

The formula [Create Date] consists of these functions: ToDate(DateTimeStart()), its type is Date.

 

My output renders "null" .

Archaeopteryx
10 - Fireball

Hey everyone,

 

I got this working now. I appreciate all your input. I have to focus on keeping the data types straight. I want to use a format of "July 4, 2019" So, that's a V_String, not a date. duh! 

 

Thanks again,

 

Chris

EoinK
5 - Atom

Thanks!

 

This was ideal, sorted it immediately 

Labels