Greets:

I know this is a bit convoluted but I have names (field name =
'legalname') in one table that are formatted as last name-comma-first
name. 

I made a computed column that extracts just the first name (everything
after the comma) using this for the computation: 

(sget(legalname,((sloc(legalname,', '))-1),1))

It basically grabs anything that is at the end of a data field and after
a comma.

I made a second computed column that extracts just the last name
(everything up to the comma) using this for the computation:

(sget(legalname,(slen(legalname))-((sloc(legalname,','))),((sloc(legalna
me,', '))+2)))  

You might use this to parse out some of your data as opposed to doing it
by hand.

Good Luck,
Dave Fitts



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Lin
MacDonald
Sent: Sunday, January 13, 2008 9:37 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - pulling a text column apart

Sorry, another Newbie question --

As I redesign my Database and application, I want to correct some design
problems.  One of them is that in my Supplier table, I have one column
for Contacts.  I'd like to move that column to another table with
multiple fields, such as First Name, Last Name, etc.  The problem is
that the data in that field is not consistant.  It could contain the
following:

Null
FName
FName LName
FName1, FName2
FName1, FName2, FName3

So, what would be the best way to break it apart?  Should I use a
temporary table?  I thought of using SSUB, but that wouldn't work for
the ones that had a First and Last name in the field with just a space
in between.

thanks,

Lin MacDonald


Reply via email to