Date Time Issue
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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')
