如何更改水晶报表中的日期格式

时间:2012-05-28 10:16:55

标签: crystal-reports inet

有人可以告诉我如何更改水晶报告中的日期格式。

这是我的编码。

FormulaField for_date_of_birth = fields.addFormulaField(“f_date_of_birth”,“Totext({hr_rpt_employee.date_of_birth})= \”1900-01-01 \“”,FormulaField.FORMULA_PROPERTY);

这里我想要MM / DD / YYYY格式,但是就像YYYY / MM / DD formarmat一样

提前致谢。

2 个答案:

答案 0 :(得分:0)

您可以将Totext与可选参数一起使用,该参数是指定如何格式化字符串表示的字符串。默认值取决于系统区域设置。

Totext({hr_rpt_employee.date_of_birth}, "MM/dd/yyyy" )

示例

ToText( CurrentDate, "MM/dd/yyyy")

输出:01/11/2013

答案 1 :(得分:0)

选择列,然后右键单击pic日期格式enter image description here