Skip to content
Advertisement

Extract last day of the month from MMM(M)YYYY

How can I extract the last day of the month from dates like

DEC2009, APR2013, AUG2008, NOV2017, JUL2014 etc.

I’ve tried datepart, convert, cast, month, year and I keep getting in a mess with type conversion errors.

Advertisement

Answer

Use try_convert and eomonth()

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement