在Crystal Report中显示月份名称而不是月份编号

时间:2014-02-03 10:41:12

标签: crystal-reports-2010

如何在Crystal Report中显示月份名称而不是月份编号(非数据格式编号?)

1 个答案:

答案 0 :(得分:11)

当您提供1到12之间的数字(1表示1月)时,MonthName功能可用于显示月份名称。它对于在图表中的组标题或标签组中显示月份名称非常有用。

它可以与DatePart函数结合使用,以返回变量或计算的月份名称。

语法

 MonthName(month, abbr) 

    Month   A number from 1 to 12.    
    abbr    Optional.A Boolean value. If true, the month name is abbreviated. The default is false.

<强>实施例

Example                                 Result
MonthName(5)                            “May”
MonthName(10)                           “October”
MonthName(10,True)                      “Oct”
MonthName(DatePart(“m”, CurrentDate))   “October” when the current date is 10/5/10.
相关问题