Can't cast [] to date value

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)

    <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

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 http://lucee.org/On 6/13/2016 2:47 PM, Josh Beach wrote:

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)

    <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


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+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/b7821d23-0556-4d92-a5a6-3cac7216834c%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b7821d23-0556-4d92-a5a6-3cac7216834c%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.