Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Putting the "th" into the Date

Hi everyone,

I have all the standard date format options, but not the one I want

Rather than display   "December 24 2014", I want to display "December 24th 2014"  or   "Jan 1st 2015" rather than "Jan 1 2015".

Suggestions would be welcome!

Many thanks

Gill

replied

HI Gill,

Create a variable

Suffix

=Substr("thstndrdth";

If(9<(2*ToNumber(Right(FormatNumber(DayNumberOfMonth(CurrentDate());"#");1))*((If(DayNumberOfMonth(CurrentDate())<11;89+DayNumberOfMonth(CurrentDate());Mod(DayNumberOfMonth(CurrentDate())-11;100)))>2)+1);9;(2*ToNumber(Right(FormatNumber(DayNumberOfMonth(CurrentDate());"#");1))*((If(DayNumberOfMonth(CurrentDate())<11;89+DayNumberOfMonth(CurrentDate());Mod(DayNumberOfMonth(CurrentDate())-11;100)))>2)+1));2)

Final output

=Month(CurrentDate())+" "+ DayNumberOfMonth(CurrentDate())+[Suffix]+" "+FormatDate(CurrentDate();"yyyy")

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question