Linda L Posted January 7, 2016 Posted January 7, 2016 I am using a calculation field to combine first and last name. The calculation (First Name & " " & Last Name) works fine when the last name contains no blanks or hyphens. When the last name contains a space or hyphen between two words, such as in "De Liban" or "De-Liban", the calculation drops everything after the space or hyphen. What can be done about this besides the obvious of not using spaces or hyphens in the last name? Thanks everyone. Linda
bruceR Posted January 7, 2016 Posted January 7, 2016 The calculation you have presented has no problem with hyphens or spaces in the last name. So something is missing here.
webko Posted January 7, 2016 Posted January 7, 2016 To expand on Bruce's reply - that calculation, as shown, will not behave as described. It will definitely put the First Name and Last Name together in full. I suspect this is to do with the display of the results afterwards - attached is the result of that calculation, displayed in three different ways on a layout. The middle one still has the full text, but it is cut off by the size of the field. A more esoteric possibility may be that the calculation also has some form of LeftWords calculation applied to it. 1
Ocean West Posted January 8, 2016 Posted January 8, 2016 Make sure the result is "text" not "number" as the hyphen may treat it as a calculation I prefer, this method. Trim ( Substitute ( List ( Trim (GetValue ( FirstName; 1) ) ; Trim ( GetValue (LastName;1) ) ) ; "¶" ; " " ) ) Ensures you only get the first line of text from each field and removes trailing spaces and then only ads a space if both names are present.
comment Posted January 8, 2016 Posted January 8, 2016 5 hours ago, Ocean West said: Make sure the result is "text" not "number" as the hyphen may treat it as a calculation No, that is not possible. A text character will never be treated as an operator, unless you coerce the text to become a formula by passing it as the parameter to the Evaluate() function. 1
Recommended Posts
This topic is 3299 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