Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stjernvd
Partner - Creator
Partner - Creator

Return text value for Max(Month)

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?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Or

=Month(Max(TradeDay))

View solution in original post

6 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Something like this?

=Date(Max(TradeMonth), 'MMM')

alexandros17
Partner - Champion III
Partner - Champion III

SubField(MonthNames,';',Max(TradeMonth))

let me know

swuehl
MVP
MVP

Or

=Month(Max(TradeDay))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or this?

=Capitalize(SubField(MonthNames, ';', Max(TradeMonth)))

swuehl
MVP
MVP

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.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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