Apr 21, 2021 #1 TheLazyPig Programmer Joined Sep 26, 2019 Messages 106 Location PH Hi! How can I change Lastname;Firstname;mi to Lastname, Firstname mi? Thanks in advance.
Apr 23, 2021 #2 Andrzejek Programmer Joined Jan 10, 2006 Messages 8,576 Location US If you have this data in your table: [tt] table: People Person Brown; Jack; X White; Susie; Q[/tt] and you want to have: [tt] table: People Person Brown, Jack, X White, Susie, Q[/tt] You can simply do:[tt] Update People Set Person = Replace(Person, ';', ',')[/tt] Unless you want something completely different... ---- Andy "Hmm...they have the internet on computers now"--Homer Simpson Upvote 0 Downvote
If you have this data in your table: [tt] table: People Person Brown; Jack; X White; Susie; Q[/tt] and you want to have: [tt] table: People Person Brown, Jack, X White, Susie, Q[/tt] You can simply do:[tt] Update People Set Person = Replace(Person, ';', ',')[/tt] Unless you want something completely different... ---- Andy "Hmm...they have the internet on computers now"--Homer Simpson
Apr 23, 2021 1 #3 carp MIS Joined Sep 16, 1999 Messages 2,622 Location US If you want the first semicolon changed to a comma and the rest changed to a blank, I think this will do it. Full disclosure - not tested. Code: ... substr(Person, 1, instr(person,';')- 1 )||', '||REPLACE(substr(person,instr(person,';')+1),';',' ') ... Upvote 0 Downvote
If you want the first semicolon changed to a comma and the rest changed to a blank, I think this will do it. Full disclosure - not tested. Code: ... substr(Person, 1, instr(person,';')- 1 )||', '||REPLACE(substr(person,instr(person,';')+1),';',' ') ...
Apr 27, 2021 Thread starter #4 TheLazyPig Programmer Joined Sep 26, 2019 Messages 106 Location PH The code was working. Maybe the problem is where I run it. I'm running it on foxpro v9 but the tables I used is from an oracle db. Upvote 0 Downvote
The code was working. Maybe the problem is where I run it. I'm running it on foxpro v9 but the tables I used is from an oracle db.