Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
I would like to do this:
Date(Date#([Date],'DD-MMM-YY'),'DD MMM YYYY') as Day,
Month(Date(Date#([Date],'DD-MMM-YY'),'DD MM YYYY') ) as Month,
Year(Date(Date#([Date],'DD-MMM-YY'),'DD MM YYYY')) as Year
My months are May, June, and July.
When I do Max(Month), I get 7, how do I get it to return Jul?
Something like this?
=Date(Max(TradeMonth), 'MMM')
SubField(MonthNames,';',Max(TradeMonth))
let me know
Or
=Month(Max(TradeDay))
Or this?
=Capitalize(SubField(MonthNames, ';', Max(TradeMonth)))
BTW, there is no need to format a date value using Date() function if you want to further transform it to month or year value:
Month(Date#([TradeDate],'DD-MMM-YY') ) as TradeMonth,
Year(Date#([TradeDate],'DD-MMM-YY') ) as TradeYear
should be enough.
Please note that Stefan's solution returns the Month of the latest date and not the Maximum Month overall (as you seemed to require)
Best,
Peter