Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trimming record feild

Status
Not open for further replies.

mousematt

MIS
Feb 5, 2001
102
GB
Hope some one can help.
I'm pulling some records back from a SQL db theres no problem there using <%= objRS(&quot;record&quot;) %>. easy no problem.

I want to limit how many charactors are displayed from this record so instead of;

&quot;this is a long long record and i don't want all of it&quot;

I want some thing like;

&quot;this is a long long record&quot;

I thought that the trim function would do it.... I was wrong!

Any one help?
 
dim strTest, LString

strTest = objRS(&quot;record&quot;)
LString = Left(strTest, 15)

The 15 can be replace with how many spots from the left you want.

 
Thanks just found the 'Left' command

left(objRS(&quot;feild&quot;),10) displays the first 10 chrs from the left

Thanx though.
 
You could also do it in your SQL-string like this:

SELECT LEFT(Field,10) FROM Table

which probably will perform better...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top