can't cast [] to date value

已查看 282 次
跳至第一个未读帖子

Josh Beach

未读,
2016年6月13日 17:47:272016/6/13
收件人 Lucee
I get this error when attempting to do a date comparison.

The code:


        <cfquery name="qryerpdates" datasource="#request.appname#">
        SELECT erp_erp_type, erp_dt_expire, erp_dt_retro FROM erp_mstr WHERE erp
_mstr.rowid = #Client.rowid# with (nolock)
        </cfquery>

        <cfif month(qryerpdates.erp_dt_expire) EQ month(qryerpdates.erp_dt_retro
) AND
        day(qryerpdates.erp_dt_expire) EQ day(qryerpdates.erp_dt_retro) AND
        year(qryerpdates.erp_dt_expire) - year(qryerpdates.erp_dt_retro) GTE 5>


Any thoughts? Thanks!

Josh

Igal @ Lucee.org

未读,
2016年6月13日 18:29:302016/6/13
收件人 lu...@googlegroups.com

well, are you sure that you are passing valid dates as parameters? 

the bracket symbols '[' and ']' are added by the error message reporter, so what it shows is that you are passing an empty string where a date value is required (probably at one of the functions that expect a date like month(), day(), or year().


Igal Sapir
Lucee Core Developer
Lucee.org

--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b7821d23-0556-4d92-a5a6-3cac7216834c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

回复全部
回复作者
转发
0 个新帖子