Function to shorten column

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.
LVL 8
thenoneAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have to specify what you understand by "words".
For the others, the database is MySQL 5 (as from previous post)...

0
 
thenoneAuthor Commented:
my mistake all of the words are seperated with a space.
0
 
thenoneAuthor Commented:
Yeah that should work a little sloppy but I only need it to run one time thanks angel
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.