Alteryx Designer Desktop Discussions

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

Date Time Issue

Ahasan13
7 - Meteor

Hello, 

 

I am trying to get the end of month date for some something like this "2020-11-30" but I keep getting this error "Formula (90) DATETIMEPARSE: Cannot convert "2020-11-30" to a date/time with format "%m-%d-%Y" and language "English": Month number is out of range 1..12: '2020-11-30'" Not sure how to fix this. 

2 REPLIES 2
damalraj22
Alteryx
Alteryx

Hi,

Do you mind posting an image of the tool configuration or the workflow file to take a look at. One thing to look at is to make sure the date field is actually a Date data type. If it is a string, you may need to use the DateTime Parse tool to convert it to a Date data type. 

DataNath
17 - Castor

Hey @Ahasan13 your date there is already in the correct format for Alteryx (ISO: YYYY-MM-DD) and you therefore don't need to parse it. By trying to apply DateTimeParse() with the pattern as %m-%d-%Y you're saying to Alteryx that the incoming date is in MM-DD-YYYY format, hence why you're getting the error that the date is out of range, as you're saying here that the month is 2020, day is 11 and year is 30.

 

If you want the end of the month, you can just use the following:

 

DateTimeTrim([Date],'lastofmonth')

 

DataNath_0-1670267970865.png

Labels