Copy link to clipboard
Copied
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.
Without any extra info, I'd guess that changing the cfsqltype to cf_sql_timestamp will sort the issue.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Do the variables ARGUMENTS.send_*_date and send_*_date refer to the same values?
What happens if you use the same variables in both select statements?
Copy link to clipboard
Copied
It was the sql type. Thanks to everyone for your help.
Copy link to clipboard
Copied
Without any extra info, I'd guess that changing the cfsqltype to cf_sql_timestamp will sort the issue.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more