?
Solved

Function to shorten column

Posted on 2006-04-04
4
Medium Priority
?
208 Views
Last Modified: 2010-04-07
I need a function that will make a column in my table from 29 words to 25 words another words shorten it from 29 words to 25 words.
0
Comment
Question by:thenone
  • 2
  • 2
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16372880
you have to specify what you understand by "words".
For the others, the database is MySQL 5 (as from previous post)...

0
 
LVL 8

Author Comment

by:thenone
ID: 16373094
my mistake all of the words are seperated with a space.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 16373189
the following code should work "more or less", not tested

dim rs as adodb.recordset
dim f () as string

set rs = new adodb.recordset
rs.open 'select * from yourtable'

while not rs.eof
  f = split( rs.field("words_column").value, " ")
  redim preserve f ( 0 to 24 ) as string
  rs.field("words_column").value = rtrim( join ( f, " "))
  rs.update
  rs.movenext
wend

rs.close
0
 
LVL 8

Author Comment

by:thenone
ID: 16373263
Yeah that should work a little sloppy but I only need it to run one time thanks angel
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

850 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