I have a string field that consists of a customers full name, for example "Mr Stephen Harrisson" I need to display the above example in three seperate fields ie:
"Mr"
"Stephen"
"Harrisson"
Please post some examples of your data that will show the possible scenarios that you will face. If you provide good examples, the experts can get you examples quicker than if you make them guess.
If you need a field for each part of the name then the only way is to create a separate formulas for each part and use LB's formulas to test the string and split out where necessary
i.e.
//{@Formula1}:
stringvar array x := split({table.fullname}," ");
x[1]
//{@Formula2}:
stringvar array x := split({table.fullname}," ");
if ubound(x) >= 2 then
x[2]
What is the overall purpose of what you are trying to achieve ? there may be a better solution.
We have been asked to output a file from our database into a rigid template; for each record that we output we MUST populate the 'Surtname' field within the template.
However the problem we have is that the surname could be stored in one of two places; either the 'Surname' field, or as part of the 'Full name' field.
If the 'Surname' field has a value then we want to use this, else we need to extract the surname from the 'Full name' field.
I appreciate that this is not going to be wholly accurate, however I would be comfortbale with the output if I could evaluate the 'Fullname' field to use all characters after the last space.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.