Skip to main content
March 24, 2011
Answered

Confused...

  • March 24, 2011
  • 2 replies
  • 958 views

I'm trying to switch to using cfqueryparams but I have something weird happening... This is what works:

SELECT ...   
    WHERE trade_date_time >= #createODBCDateTime(ARGUMENTS.send_start_date)#
    AND trade_date_time <  #createODBCDateTime(ARGUMENTS.send_end_date)#
  

And this does not

SELECT ...  

    WHERE trade_date_time >= <cfqueryparam value="#send_start_date#" cfsqltype="cf_sql_date">
    AND trade_date_time < <cfqueryparam value="#send_end_date#" cfsqltype="cf_sql_date">

Why?

I'm just sending a start and end date and want to find the entries between them.

    This topic has been closed for replies.
    Correct answer Owainnorth

    Without any extra info, I'd guess that changing the cfsqltype to cf_sql_timestamp will sort the issue.

    2 replies

    Owainnorth
    OwainnorthCorrect answer
    Inspiring
    March 24, 2011

    Without any extra info, I'd guess that changing the cfsqltype to cf_sql_timestamp will sort the issue.

    ilssac
    Inspiring
    March 24, 2011

    Can you define "does not work"?

    I.E.

    Does it throw an error, if so what error?

    Does it use values, but the wrong values, if so what are the value before and after?

    Or is it some other type of failure?

    Inspiring
    March 24, 2011

    In addition to ilssac's questions it would also be useful to know:

    1. The database  you are using, including product and version.

    2. The data type of the trade_date_time column.

    March 24, 2011

    The result at the top returns 286 items and the second one returns 0.

    I'm using mysql 5.0.2 I think.

    There is no error just the wrong results or lack there of results.