Convert date to just number of the month
- 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
Hi all,
I have column with "date" date type field and the values there are for instance "DEC-20", "NOV-20".
I would like to change this column to the number of the month, e.g. "12", "11", ... .
Anyone has a simple solution to do so?
Alternatively, it it's easier to convert to the month number from the string, please say so. In my workflow I currently converted the string already to a date field. So both options are fine for me.
Really appreciate your help and many thanks in advance.
Have a nice day,
Christoph
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @ChristophVW ,
You can try using the DatetimeMonth() function which will return you the numeric value for a month in a date field.
So if your date field is called [Order Date] then the formula you should use is:
Tostring(Datetimemonth([Order Date]))
Hope that helps,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much @AngelosPachis ! Works like a charm.
Only did a very minor tweak from 'Tostring' to 'Tonumber' in my case, but visually the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @ChristophVW ,
Try removing the 'Tonumber' part of the expression and see if it works without it. What the DateTimeMonth function returns to you is already a numeric value, so probably you can remove that part of the expression to make it less complicated.
Cheers,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How do I convert "16-JUN-01' to date format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Using a DateTime Tool:
The %b symbolizes the 3 letter word for Month, whereas %B is for the full name of the month.
Hope this helps.
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
