Coldfusion: Dealing with Null values in Date Field

ぐ巨炮叔叔 提交于 2019-12-07 17:59:24

You're leaving out the most important part - the actual CFC and the query that does the insert. What's happening is your <cfargument> tag is typed as 'date' so when you pass an empty string the validation fails. (This is one of the reasons I don't type my arguments).

You'll need to either turn off type checking or change the argument type to 'string' or 'any'. Now, when you do that you'll also need to change your <cfqueryparam> tag (you are using <cfqueryparam>, aren't you?!) to something like this:

<cfqueryparam .... null="#not len(trim(arguments.thedate))#" />

That'll fix ya...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!