Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Limit the word count for each record returned

Posted on 2006-04-22
Medium Priority
Last Modified: 2013-12-24
Hello everybody,

I have a recordset the returns a maximum of five of the latest records from my database with ColdFusion. What I would like to do is limit the word count as well for each record returned, for example:

Current Method:
This is some text returned from my query.

The way I would like it to run:
This is some text returned…

I want to limit the word count returned as well and add the three dots (…) at the end to let users know there is more.

Any thought on how to achieve this?

Thanks in advance,
Question by:EnginesofCreation
  • 2
LVL 36

Expert Comment

ID: 16516157
<cfquery name="sometext" datasource = "mydata">
select * from mytable

<Cfloop query=Sometext">

#left(sometext.mytext, 75)# <a href="www.somesite.com/text/#sometext.TextID#.cfm"> More ...</a>


LVL 36

Accepted Solution

SidFishes earned 1500 total points
ID: 16516172
oops of course that doesn't do word count, just chars...

this will do words


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question