Alteryx Designer Desktop Discussions

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

V_String to date

mszpot89
9 - Comet

I want to extract last day of month from below v_string date:

 

05/02/2018 00:01:00

I've managed to get it formatted to desired date format

 

datetimeformat(DatetimeParse([Date],"%d/%m/%Y"),"%d/%m/%Y")

 

How to get last day of the month now? 

This code returns error:

 

DateTimeLastOfMonth(datetimeformat(DatetimeParse([Date],"%d/%m/%Y"),"%d/%m/%Y"))

"Wrong number of parameters"
3 REPLIES 3
neilgallen
12 - Quasar

@mszpot89 The little used "datetimetrim" function will trim dates to either 'firstofmonth' or 'lastofmonth' as below:

 

 

datetimeformat(datetimetrim(DatetimeParse([Date],"%d/%m/%Y"),'lastofmonth'),"%d/%m/%Y")

 

 

mszpot89
9 - Comet

It looks like I've mixed the order of function ;)

neilgallen
12 - Quasar

Two things:

 

1) datetimelastofmonth isn't a function as it only gives you last (or first) of month of the current date.

2) the datetimeformat function was creating a string with the date, formatted in the version you wanted. In that case the datetimetrim function wouldn't work either. That's why the order matters.

Labels