Character Trim

D

danielst.clair

I'm pulling customer testimonials from an SQL database onto the
homepage of a site. I want to set a trim that will not allow more than
250 characters of the testimonial to show. Anything over 250 would be
cut of and replaced with "..." I already have a link below that will
take them to a page that displays all testimonials. Current code (a
little messy):

<td width="220" height="97" valign="top">
<span
class="style4">&quot;<%=(Testimonials.Fields.Item("test_desc").Value)%>...&quot;<br
/>
-
<%=(Testimonials.Fields.Item("test_name").Value)%></span></td>

I want to trim the "test_desc." Any Ideas?
 
J

Jared

Daniel

The simplest method would be in your SQL string.

Use

Select SubString(test_desc,0,250) + '...' as test_desc_trimmed,
test_name from tblMyTable

Then change your html to point to the renamed field.

Jared
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top