【发布时间】:2023-03-27 21:04:01
【问题描述】:
如何在 Crystal Report 中显示月份名称而不是月份编号(不是数据格式编号)?
【问题讨论】:
-
使用
MonthName,如图here。
如何在 Crystal Report 中显示月份名称而不是月份编号(不是数据格式编号)?
【问题讨论】:
MonthName,如图here。
MonthName 函数可用于显示月份的名称,当您提供一个介于 1 和 12 之间的数字时(1 表示一月)。这对于在组标题中显示月份名称或在图表中标记组很有用。
它可以与 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.
【讨论】: