Campus Club Posted January 14, 2005 Share Posted January 14, 2005 I am working with a database that has been imported into FM7 and I have a first and last name field. Unfortunately many of the names are in the last name field only instead of being split between the two fields. What command can I use in a script to select the first word the 'last name' field and then move it into the blank 'first name' field? Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 14, 2005 Share Posted January 14, 2005 Hi, set field["first_name", "LeftWords(last_name;1)"] should do it. kjoe Link to comment Share on other sites More sharing options...
Campus Club Posted January 14, 2005 Author Share Posted January 14, 2005 Yes, that moved the first name to the first name field, but it also left it behind in the last name field. How do I set it to delete the first name after that? Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 14, 2005 Share Posted January 14, 2005 oh yes. set field["last_name","RightWords(last_name;1"] assuming you have no names like "John Stuart Mill, jr" kjoe Link to comment Share on other sites More sharing options...
Campus Club Posted January 14, 2005 Author Share Posted January 14, 2005 Ooh, that's the thing, I do have a lot of 3 or 4 part names. Is there anyway to just select that first word and then clear it or cut it? Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 14, 2005 Share Posted January 14, 2005 set field["your_field", "Substitute(your_field;leftwords(your_field;1;"")"] kjoe Link to comment Share on other sites More sharing options...
Inky Phil Posted January 14, 2005 Share Posted January 14, 2005 Kjoe is the substitute function above avaiable in FM5? Phil Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 14, 2005 Share Posted January 14, 2005 Hi Phil, I don't have 5.0, just 5.5, it is available in 5.5. kjoe Link to comment Share on other sites More sharing options...
Inky Phil Posted January 14, 2005 Share Posted January 14, 2005 I'll have a look Many Thanks Phil Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.