FM-Monster Posted September 28, 2005 Posted September 28, 2005 (edited) This is my first posting on FMForums so I don't know what to expect... My problem is that I have data (being a city name and a county name) in one field that is seperated by a comma. I want to seperate the two from each other and get them in seperate fields. I immediately tried to use first word and last word functions but realized it didn't work--of course the cities are sometimes one or two words as well as the counties. Is there a function that I can use that will recognize the comma in the middle and pull out data respectively? Help!! Edited September 28, 2005 by Guest
-Queue- Posted September 29, 2005 Posted September 29, 2005 You could use a Position function to determine where the comma lies and use the comma as a delimiter, but it is probably easier to substitute a carriage return for the comma and calculate using the Right and LeftValues functions. City: Substitute( LeftValues( Substitute( yourField; ", "; ¶ ); 1 ); ¶; "" ) County: Substitute( RightValues( Substitute( yourField; ", "; ¶ ); 1 ); ¶; "" ) If there is no space after the comma in your field, remove the space following it in the calculations.
FM-Monster Posted September 29, 2005 Author Posted September 29, 2005 I am very impressed!!! I tried it and it worked. Thanks a million My first experience with FM Forums turned out to be great...
Recommended Posts
This topic is 6996 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now