sql help for getting fixed amout of text from database

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

  1. #1

    Default sql help for getting fixed amout of text from database

    hi,
    I have this SQL statement.:
    <cfquery name="showall" datasource="#request.dsn#">
    SELECT TOP 6
    p.blog_id,p.blog_date,p.blog_headlines,p.blog_cont ents,p.blog_name,p.blog_time,p
    ..blog_email,p.counter_viewed,p.keywords,p.thumbna il,c.blog_cat_name,c.blog_cat_i
    d FROM blog_posts p left outer join blog_category c on p.blog_cat =
    c.blog_cat_id order by p.kount desc;
    </cfquery>

    can somebody guide me how can i return only 200 characters from the database,
    not more.

    thanx

    merlinvicki Guest

  2. Similar Questions and Discussions

    1. HoPDFs with some text fixed and some texteditable by Acrobat Reader
      Hi there. Can someone help? I have Acrobat 6.0 Standard and I need to create a PDF that has almost all of the text and images fixed but also has a...
    2. PDFs with some text fixed and some text editable by Acrobat Reader
      Hi there. Can someone help? I have Acrobat 6.0 Standard and I need to create a PDF that has almost all of the text and images fixed but also has a...
    3. Fixed Length Text Extract, Write to Excel
      Hello All, I am trying to work with the code I have to extract fields from a text file report, and write the values into excel. I am having...
    4. Fixed Width layout cells expanding with text ??
      Hi - got the same problem I went trhough the tutorial, but have some questions: When it talked about 'balloon cell', and wrote "I have a small...
    5. Best way to query a flat fixed length text file
      I am trying to insert a semi fixed length file into a SQL database. Does anyone know of a way to query a fixed length file like you can a csv to...
  3. #2

    Default Re: sql help for getting fixed amout of text fromdatabase

    200 characters of what?

    If your db has a substring function you can use it on any character field.
    Dan Bracuk Guest

  4. #3

    Default Re: sql help for getting fixed amout of text fromdatabase

    Originally posted by: Dan Bracuk
    200 characters of what?

    If your db has a substring function you can use it on any character field.

    Hi, Thanks for replying. I have this blog:
    [url]http://merlinvicki.in/index.cfm?content=blogs[/url]

    i want only 200 chars to be displayed for each entry. Right now all the text i
    have in the database is reflected on the page. I just want to constraint it to
    display only 200 characters per blog entry. I hope I am clear.

    thanx



    merlinvicki Guest

  5. #4

    Default Re: sql help for getting fixed amout of text fromdatabase

    So you want the 1st 200 characters of p.blog_contents?

    If your db has a substring function use it. Otherwise select the whole field and use the cold fusion left function.
    Dan Bracuk Guest

  6. #5

    Default Re: sql help for getting fixed amout of text fromdatabase

    Grrreat!

    Thanxs Dan, The Left function did the trick.

    Anybody else looking for the answers can check it out here:
    [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functib2.htm[/url]

    regards
    merlinvicki

    merlinvicki 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