Crystal Reports日期格式

时间:2010-02-16 08:38:19

标签: crystal-reports

如何将日期字段格式化为第1个第2个第3个等等?感谢

1 个答案:

答案 0 :(得分:4)

我找到了解决方案。

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')

来自http://www.kenhamady.com/news0910.shtml