May 11, 2006 #1 roisinmck Technical User Joined May 11, 2006 Messages 4 Location US I'm using foxpro/sql I have a name field but unfortunatley is has both the first and last name within the same field. As noted above 'Johnson,Emily' How do I parse out the name into different fields?
I'm using foxpro/sql I have a name field but unfortunatley is has both the first and last name within the same field. As noted above 'Johnson,Emily' How do I parse out the name into different fields?
May 11, 2006 #2 mirtheil Programmer Joined Jun 20, 2001 Messages 1,556 Location US This should work (tested with PSQL v9.1): Code: select left(FieldName,locate(',',FieldName)-1),right(rtrim(FieldName),(length(f1) - locate(',',FieldName))) from TABLE Mirtheil Certified Pervasive Developer Certified Pervasive Technician http://www.mirtheil.com Upvote 0 Downvote
This should work (tested with PSQL v9.1): Code: select left(FieldName,locate(',',FieldName)-1),right(rtrim(FieldName),(length(f1) - locate(',',FieldName))) from TABLE Mirtheil Certified Pervasive Developer Certified Pervasive Technician http://www.mirtheil.com