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

  1. #1

    Default Sum exceeds 32,767

    I am trying to find the average call length in our database of support calls by
    using "SUM(calltime) AS time_total" and then dividing that by the number of
    incidents. The field I am searching on, calltime, is short integer.

    If time_total is more than 32,767, it returns either an error or a negative
    value depending upon the version of the database I'm using. I understand why
    this is happening, but can't figure out how to fix it. I can't change the
    database; it's enormous. Is there some way to specify that time_total needs to
    be a long integer?

    Ellen K Guest

  2. Similar Questions and Discussions

    1. CF Flash Forms - code exceeds the 64K byte limit error
      In my form I am getting the error: A function in the code exceeds the 64K byte limit (actual size = '65801'). Since the problem occurs in the...
    2. The illustration exceeds an implementation limit.
      I posted this yesterday on the windoze side... I worked for a good hour on a native .ai file in AIv9.0 in WinXP, saving often, then closed it and...
    3. Exceeds Excel Limits to convert datagrid
      Hi, I am using the standard code to convert a datagrid into an excel format. The only problem, that I face is how do i go about filling an...
    4. Flash movie exceeds 256k and wont load
      im a newbie at this and need some help i have tried to make multiple flash movies for my site but if they are over about 250k they wont load. This...
    5. A quote string exceeds 256 bytes
      Hi I use ODBC to connect database (Informix SQL-version 7.20.UD6 ) for my asp files. when save data with a long value, say, more than 300...
  3. #2

    Default Re: Sum exceeds 32,767

    Database size is not the obstacle in this case (hopefully you have Oracle or SQL Server). You (or your DBA)could increase the column size to long integer without loosing data.
    CF_Oracle Guest

  4. #3

    Default Re: Sum exceeds 32,767

    If you can't alter the datatype in the database, you might try casting calltime
    as an int or bigint, something like

    SUM(CAST(calltime AS int)) AS time_total
    or perhaps
    CAST(SUM(calltime) AS int) AS time_total

    Phil

    paross1 Guest

  5. #4

    Default Re: Sum exceeds 32,767

    Not only is the database enormous but we have several other very important
    office applications running off it, and any change could impact those other
    applications. It's something that I can assure you the DBA and president will
    NOT want to do.

    My thought was that since SUM creates a generated column, is there some way to
    specify what kind of column that is? If not, it's no big deal.

    Thanks for your input.

    Ellen K Guest

  6. #5

    Default Re: Sum exceeds 32,767

    Didn't you actually read my previous post? That is what I was recommending that you do. CAST the selected column to an INT or BIGINT within the query, NOT in the database.

    Phil
    paross1 Guest

  7. #6

    Default Re: Sum exceeds 32,767

    Thanks, you were writing that as I was typing my other reply. Yes, that's the direction I was trying to go in. I am unfamiliar with CAST but will play around with that.

    Thanks again!
    Ellen K Guest

  8. #7

    Default Re: Sum exceeds 32,767

    Got it. Of course it depends on the database, and I was assuming SQL Server, so you may mave problems if you were using Access 97, or an old version of Oracle (pre-9i), etc.

    Phil
    paross1 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