Solved

How to truncate information from database

Posted on 2006-11-24
2
128 Views
Last Modified: 2010-04-25
I have a view page which displays a description field for each record in my database. Some of the description fields are too long and I want to cut them shorter on this page so that they only appear in full on the details page. Is there a way to cut off everything but the first 100 characters?

<td width="552">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=(rsrestaurants.Fields.Item("description").Value)%></td>
0
Comment
Question by:elliottbenzle
  • 2
2 Comments
 
LVL 17

Expert Comment

by:cem_turk
ID: 18009597
<td width="552">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% document.write(Left(rsrestaurants.Fields.Item("description").Value,100))%></td>
0
 
LVL 17

Accepted Solution

by:
cem_turk earned 500 total points
ID: 18009608
oops mixed document.write with response.write :)

here you are

<td width="552">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% response.write(Left(rsrestaurants.Fields.Item("description").Value,100))%></td>
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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