views:

82

answers:

1

Hi, how can I format the day from a date field to print like 1st 2nd 3rd and so on? Thanks

+1  A: 

I found a solution for this.

NumberVar DayIn := Day (PrintDate);
Totext (DayIn , 0 )
& (if DayIn in 4 to 20 then 'th' else
if remainder (DayIn , 10) = 1 then 'st' else
if remainder (DayIn , 10) = 2 then 'nd' else
if remainder (DayIn , 10) = 3 then 'rd' else 'th')

from http://www.kenhamady.com/news0910.shtml

andySF
You should mark it as the accepted answer if it works for you
CodeByMoonlight