Matt Leach Posted July 26, 2010 Posted July 26, 2010 The database im working on has a primary ID and a secondary ID. The primary is a phone number while the secondary is the clients name. The secondary ID needs to be in the following format: Last First I currently have a field for the clients name that i would like to copy from, but how would i copy the name and reverse the first and last names?
Lee Smith Posted July 26, 2010 Posted July 26, 2010 That is a major flaw in design. You should first create fields for Last Name and First Names and parse the Full Name field into them. Then the you can use these names in any order, or any part of them in the future. There has been several topics in the past about parsing full name fields, do a search for your keywords +Parse +Full Name +Field Variables of this would be +Extract +fullname +field I remember someone asking this question within the last week in the Calculation Topic (I think) Unfortunately, I'm on my way out of the office,so if you don't find anything, let me know and I'll provide you some links when I return. Lee
Fitch Posted July 26, 2010 Posted July 26, 2010 Using a phone number or a name as an ID is generally a Bad Idea. Phone numbers can change, and so can names. Names are not always unique either. Is there some reason you're not using an auto-entered serial number as an ID?
Lee Smith Posted July 26, 2010 Posted July 26, 2010 (edited) I have a couple of minutes, so start with this thread Link I like this caclulation by comment. Assuming the only space in the field is the one separating first and last name, you could use = GetValue ( Substitute ( FullName ; " " ; ¶ ) ; 1 ) for FirstName, and = GetValue ( Substitute ( FullName ; " " ; ¶ ) ; 2 ) for LastName. Modify as follows because of the order of the names. However, [color:blue]note that if there is something [color:blue]besides a space between Last and First names, we will need to know what that is. NameLast = GetValue ( Substitute ( FullName ; " " ; ¶ ) ; 1 ) NameFirst = GetValue ( Substitute ( FullName ; " " ; ¶ ) ; 2 ) Edited July 26, 2010 by Guest
Lee Smith Posted July 26, 2010 Posted July 26, 2010 Hi Tom, I was going to cover that after he splits the full name. :
Matt Leach Posted July 26, 2010 Author Posted July 26, 2010 I am using the auto-enter ID for most of the functions in the program, but they would like the phone and name for IDs as it will match up to their accounting program which uses those as ids. The reason for not initially having a field for first and last is due to the way the data is being brought over. They are using another software that i am bringing over which currently only has one field for the full name. To throw another wrench into thing, there is not always one space separating the first and last name. The clients that we enter into the database are physicians and the full name field almost always includes their specialty as well.
Matt Leach Posted July 26, 2010 Author Posted July 26, 2010 Thank you all for your assistance. Lee, that script is the ticket. I've also took the advice of having fields for first and last name, even if i am not using them now, may help down the road. Thanks again
Recommended Posts
This topic is 5292 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