Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create blanks in a data string

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CR 11

I have an account number (actually it is an IBAN) of variable text length. In the database it is held with no spaces to conform with banking standards if its use is to be elctronic payments - which it is


However for showing on a paper document I need to show a space after every 4th character. How can I do this

eg convert

GB26NWBK9000123456 to GB26 NWBK 9000 1234 56 or
FR32BNPP900012345678 to FR32 BNPP 9000 1234 5678 etc etc

Note the text maybe of variable length
 
trim(
left({field},4)&' '
&(if len({field}) > 4 then mid({field},5,4)&' ' else ' ')
&(if len({field}) > 8 then mid({field},9,4)&' ' else ' ')
... as many more as you need
)
The last closing paren if for the trim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top