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.
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
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.
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
How do I convert "16-JUN-01' to date format
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.