Skip to content

Instantly share code, notes, and snippets.

@matt40k
Created October 5, 2018 15:32
Show Gist options
  • Save matt40k/e986919a51b34d6da6611d3f5cacbc1e to your computer and use it in GitHub Desktop.
Save matt40k/e986919a51b34d6da6611d3f5cacbc1e to your computer and use it in GitHub Desktop.
SSRS expression to add th\rd\nd to day - so 1st, 2nd, 3rd, 4th etc
=str(Fields!DayNumberInCalendarMonth.Value)
+ SWITCH(
right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "1", "st"
,left(str(Fields!DayNumberInCalendarMonth.Value), 1) = "1", "th"
,right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "2", "nd"
,right(str(Fields!DayNumberInCalendarMonth.Value), 1) = "3", "rd"
,true, "th"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment