Gossamer Forum
Home : Products : DBMan : Customization :

Splitting a single field into two columns - Character Count

Quote Reply
Splitting a single field into two columns - Character Count
Hey there, all. Okay, I think I've got a good one for y'all. I have a text field in a database that has the potential for getting pretty long and what I'd like to do, basically, is have the database split THAT FIELD into two different columns when it displays html_record_long.

So, the process, in english, I'm sure would go something like:
  1. Count the number of characters in a field
  2. Divide that number by two to get 'x'
  3. Find out what the 'x'th character in the field is
  4. If 'x' is not equal to a blank space then x = x+1 (loop so that the database doesn't put a column break in the middle of a word)
  5. Once it 'x' becomes equal to a blank space, print the table tags for closing and starting a new column.


Problem is, I'm really not sure how to do this.. But it seems like it would be a fairly simple process... Nothing more than simple math, really. I just don't have a single idea as to how to get a count of the number of characters in a specified field. Any ideas anyone? Many thanks in advance. Cheers!
Subject Author Views Date
Thread Splitting a single field into two columns - Character Count wretchedhive 1933 Nov 4, 2002, 3:16 PM
Post Re: [wretchedhive] Splitting a single field into two columns - Character Count
LoisC 1865 Nov 5, 2002, 9:42 AM