Limit the Number of Characters Returned

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

  1. #1

    Default Limit the Number of Characters Returned

    I am running into a problem with a dynamically created Select Box being too
    wide due to the names included in it. How can I limit the length of the
    characters returned to keep the length of the select box to a certain size?

    d088 Guest

  2. Similar Questions and Discussions

    1. How to limit # of rows returned from query
      I am looking at setting a limit to the number of rows returned on some of my queries. I was looking at doing something like: <cfoutput...
    2. Limit Data returned to table
      Hi I have a number of large fields of data being returned and would like to limit the amount of each one that is put to my table for viewing....
    3. #25544 [Ver->Bgs]: Only 255 characters returned from varchar field
      ID: 25544 Updated by: abies@php.net Reported By: snick at getart dot ru -Status: Verified +Status: ...
    4. #25544 [Opn->Bgs]: Only 255 characters returned from varchar field
      ID: 25544 Updated by: iliaa@php.net Reported By: snick at getart dot ru -Status: Open +Status: Bogus...
    5. #25544 [NEW]: Only 255 characters returned from varchar field
      From: snick at getart dot ru Operating system: Windows 2003 Server PHP version: 4.3.2 PHP Bug Type: MSSQL related Bug...
  3. #2

    Default Re: Limit the Number of Characters Returned

    two ways. 1.) limit the size of the elements in your SQL query Left(value,25)
    for SQL Server or Access, but differs for other databases 2.) limit the size
    of the elements when you write the select box with CF: <option
    value='#value#'>#Left(value,25)#</option>

    TurboMini Guest

  4. #3

    Default Re: Limit the Number of Characters Returned

    The easiest way is to handle the issue on the query on your CF code. If your field needs to be trimmed on the right or left you can use the following syntax:

    Remove empty spaces on the left side of the returned data of a field
    SELECT field1, LTRIM(field2) as field2
    FROM yourtable

    Remove empty spaces on the rigth side of the returned data of a field
    SELECT field1, RTRIM(field2) as field2
    FROM yourtable
    Unregistered 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