Arithmetic overflow error converting expression to datatype datetime

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Arithmetic overflow error converting expression to datatype datetime

    Hi all,

    I have a web application based on CFMX 6.1, IIS 5 and MS-SQL 8.0
    On my development server the application works fine.
    On my production server i have this error
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Arithmetic overflow error
    converting expression to data type datetime.

    with this request
    SELECT DISTINCT eft_element.elt_id ,a1.pho_date_1
    FROM eft_element,PHOTO a1,photo a2
    WHERE eft_element.obj_id = 'objet000000000000012'
    AND cast(convert(nchar(10), a2.pho_date_1, 103) as
    datetime)>=cast(convert(nchar(8), '5-5-2004', 103) as datetime)
    AND a1.elt_id = eft_element.elt_id
    AND a2.elt_id = eft_element.elt_id
    AND eft_element.elt_id NOT IN (
    select eft_element.elt_id from eft_element where
    eft_element.elt_id='element0000000000001'
    ) order by a1.pho_date_1

    The only difference between the 2 servers is the default language for the
    database : french for development and english for production but date format
    are the same for French and English

    The datatype of the column ph_date_1 is datetime

    When i run this request into MS-SQL request analyzer there is no error.

    Have you an idea?

    dgiet Guest

  2. Similar Questions and Discussions

    1. Datatype mismatch in criteria expression
      All, Any help you can lend on this would be greatly appreciated. I am not a coldfusion coder by any means and have stumbled into this problem at a...
    2. Converting integers to datetime
      I have the following fields in a database: year integer(4) not null default '0' month integer(2) not null default '0' day ...
    3. #26366 [Bgs]: Arithmetic Error with JS and PHP
      ID: 26366 User updated by: JaiKMw at aol dot com Reported By: JaiKMw at aol dot com Status: Bogus Bug Type: ...
    4. Result precision and scale for decimal arithmetic expression and
      Here is your answer which you can also find by using ESQL/C program to describe the query and then use PRECISION and SCALE arguments to see the...
    5. Result precision and scale for decimal arithmetic expression and aggregate function
      Lan Huang wrote in message <48e0b0fb.0306270915.2a98365c@posting.google.com>... It depends. The easiest way to tell is to run your query...
  3. #2

    Default Re: Arithmetic overflow error converting expression todata type datetime

    Well i have found an answer on this site [url]http://www.prezzatech.com/kb/articles/kb-1029-survey_software_arithmetic_overflow_datetime.asp[/url]
    dgiet Guest

  4. #3

    Default Re: Arithmetic overflow error converting expression todata type datetime

    I also think you may have problems with this as well
    AND cast(convert(nchar(10), a2.pho_date_1, 103) as
    datetime)>=cast(convert(nchar(8), '5-5-2004', 103) as datetime)

    your converting dates to character string then comparing them, but on the left
    hand side of the comparision you have 10 characters and on the right you have 8.

    But I'm not sure why you would want to convert them at all,

    AND a2.pho_date_1 >= #CreateODBCDate("5-5-2004")#

    Ken


    The ScareCrow Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139