Skip to main content
Solved

Formatting a date in Report Designer

  • 20 October 2022
  • 4 replies
  • 1003 views

Forum|alt.badge.img

Does anyone know of a way to format a date in report designer as follows:

10th October 2022

I can get the date, month and year correct, but not the ‘th’.

Is this possible?

 

Best answer by lauraj46

Hi @suemackeown13 ,

I don’t know if there’s a standard date code for that but you could do it with a formula in the Value expression for the field, something like this:

 

=CStr(Day(Today())) + CStr(iif(Day(Today()) in (1, 21, 31), 'st', iif(Day(Today()) in (2, 22), 'nd', iif(Day(Today()) in (3, 23), 'rd', 'th')))) + ' ' + MonthName(Today()) + ' ' + CStr(Year(Today()))

Laura

View original
Did this topic help you find an answer to your question?

4 replies

Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 39 replies
  • October 20, 2022

Hi Kensium

Unfortunately that is not what I am looking for. If the date is 03.10.2022, we need it to show on the rpeort as 3rd October 2022. I can do the dd MMMM and yyyy, but what do I use for the ‘rd’?


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 502 replies
  • Answer
  • October 20, 2022

Hi @suemackeown13 ,

I don’t know if there’s a standard date code for that but you could do it with a formula in the Value expression for the field, something like this:

 

=CStr(Day(Today())) + CStr(iif(Day(Today()) in (1, 21, 31), 'st', iif(Day(Today()) in (2, 22), 'nd', iif(Day(Today()) in (3, 23), 'rd', 'th')))) + ' ' + MonthName(Today()) + ' ' + CStr(Year(Today()))

Laura


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 39 replies
  • October 20, 2022

Thank you Laura. I did thik of doing it that way but was hoping for a simpler option.

Thank you for your help.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings