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"
Solved! Go to Solution.
@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")
It looks like I've mixed the order of function ;)
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.