【问题标题】:Display Month Name Instead of Month Number In Crystal Report在水晶报表中显示月份名称而不是月份编号
【发布时间】:2023-03-27 21:04:01
【问题描述】:

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

【问题讨论】:

  • 使用MonthName,如图here

标签: crystal-reports-2010


【解决方案1】:

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.

【讨论】:

  • 查看月份缩写的语法也很有帮助
  • 我的日期和月份格式为 yyyyMM 和 int feild,我添加了这个公式来显示月份名称和年份 MonthName(ToNumber(Right(totext({FeeRecordCharges.Month},0,'') ,2))) + ' ' + Left(totext({FeeRecordCharges.Month},0,''),4)
猜你喜欢
  • 1970-01-01
  • 2014-02-24
  • 1970-01-01
  • 1970-01-01
  • 2011-12-22
  • 2018-02-15
  • 2017-02-19
  • 2020-04-03
相关资源
最近更新 更多