2 digits months become 6 digits number on your calculation, so larger than other 5 digits.
Year ( email sent ) * 100 + Month ( email sent )
Year ( email sent ) + Month ( email sent ) / 100
Specify the calculated field Year_Month as "Text" but you'll have to add another step.
** start pseudocode
if Month (email sent) < 10
then concatMonth = zero & Month (email sent)
concatMonth = Month (email sent)
Month_Year = "Year ( email sent ) & concatMonth ( email sent )
** end pseudocode
Storing the result of the calculation "Year ( email sent ) & "/" & Month ( email sent )" as a number will give unpredictable results.
My solution is not the only one or even the most elegant but is easily understood. HTH
Simple but ELEGANT!
It can be a number result and have the same # of digits AND sort correctly numerically and chronologically.
It can be a text result and still SORT correctly (as Text) with alpha & chronologically.
Thanks, I love the simplicity of this.
Apologies, I'd forgotten I'd taken the literal "/" out of the concat and the calculation result can indeed be stored as a number.