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

Problema with Migration CF8 for CF10

Guest
Oct 25, 2013 Oct 25, 2013

Hi,

After that I installation CF10 FULL STANDART my codes in CF have a problem. Every queries with date not working and to working I have chande for <cfqueryparam ....>, but my application WEB is very big and this very difficult. What I have do? Hotfix? This is a BUG?

This is error:

Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value.

Thanks,

Eduardo.

586
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 ,
Oct 25, 2013 Oct 25, 2013
LATEST

Are your queries using <cfqueryparam>?  Not only do they help prevent SQL injection, but they'll ensure that you get less issues with datatype conversions.

By the sound of it, you're attempting to send a string character and interpret it as a datetime.  For example:

<cfset dateAsString = '2003-09-30' />

The above is a string object, even though its value looks like a date.  But it's a string, often seen as a varchar by SQL.  Instead, create an actual date object:

<cfset dateAsDate = createDate( 2003, 9, 30 ) />

That way, you can pass it in a <cfqueryparam> along with the proper cf_sql_type attribute, and it should be acceptable.

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