将DateTime转换为字符串的Crystal报表已为此函数提供了太多参数 [英] Crystal report converting DateTime to string Too many arguments have been given to this function

查看:96
本文介绍了将DateTime转换为字符串的Crystal报表已为此函数提供了太多参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在水晶报表中有一个简单的公式,如下所示:

I have a simple formula like below in crystal report:

iif(isnull({employ.createdDate}),"", ToText({employ.createdDate}, "dd-MMM-yyyy"))

The {employ.createdDate} 的格式如下:

The {employ.createdDate} is in below format:

02/09/2015 10:48:25

{employ.createdDate}时效果很好为空,但是当它不为空时,以下错误消息显示:

It works fine when {employ.createdDate} is null, but when it's not null, the below error message shows:

  Too many arguments have been given to this function 
  Error in File employeeInfo.rpt: 
  Error in formula txtDate

删除 dd-MMM-yyyy确实可以解决问题,但我想将日期格式化为 dd-MMM-yyyy格式,即 09-FEB-2015

Removing the "dd-MMM-yyyy" does solve the problem but I would like to format the date to "dd-MMM-yyyy" format i.e. "09-FEB-2015"

公式出了什么问题?

推荐答案

哦,我知道了...

02/09/2015 10:48:25 是字符串格式,所以我需要转换我t到目前为止,并将其转换为字符串,我对此进行了修改,并且可以正常工作:

The 02/09/2015 10:48:25 is in string format, so I need to convert it to date and convert it to string, I modified the formula to this, and it works:

ToText(cDate({employ.createdDate}),"dd-MMM-yyyy")

这篇关于将DateTime转换为字符串的Crystal报表已为此函数提供了太多参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆