Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Confused...

Guest
Mar 24, 2011 Mar 24, 2011

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.

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Mar 24, 2011 Mar 24, 2011

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

Translate
Valorous Hero ,
Mar 24, 2011 Mar 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 24, 2011 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 24, 2011 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 24, 2011 Mar 24, 2011

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 24, 2011 Mar 24, 2011
LATEST

It was the sql type. Thanks to everyone for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 24, 2011 Mar 24, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources