Crystal report converting DateTime to string Too many arguments have been given to this function(Crystal 报表将 DateTime 转换为字符串 给此函数提供了太多参数)
问题描述
我在水晶报表中有一个简单的公式,如下所示:
I have a simple formula like below in crystal report:
iif(isnull({employ.createdDate}),"", ToText({employ.createdDate}, "dd-MMM-yyyy"))
{employ.createdDate}
格式如下:
02/09/2015 10:48:25
{employ.createdDate}
为 null 时可以正常工作,但当它不为 null 时,会显示以下错误消息:
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
是字符串格式,所以我需要将其转换为日期并将其转换为字符串,我将公式修改为这个,它可以工作:
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")
这篇关于Crystal 报表将 DateTime 转换为字符串 给此函数提供了太多参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Crystal 报表将 DateTime 转换为字符串 给此函数提供了太多参数


基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01