1 Reply Latest reply on Oct 25, 2013 3:41 PM by Aegis Kleais

    Problema with Migration CF8 for CF10

    ze_tbte

      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.

        • 1. Re: Problema with Migration CF8 for CF10
          Aegis Kleais Level 3

          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.