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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Number Sequence 1

Status
Not open for further replies.

traumarn

Technical User
Jun 23, 2005
2
US
CR Version 8.5
Oracle 9i

Need help with a formula to change the sequence of a six digit number set. I need the numbers in the 5th and 6th place markers to go to position 1&2. I need the numbers in place 1&2 to move to place 5&6. The numbers in position 2&3 remain in place. In addition I need hyphens between each two sets of numbers and the first two numbers must be bolded.

Current state: 102380
Required state: 80-23-10 with the first two numbers in bold.

Thanks for your help with this.
 
Is the field a number datatype? If so, then use a formula like:

"<b>"+right(totext({table.number},0,""),2)+"</b>"+"-"+mid(totext({table.number},0,""),3,2)+"-"+left(totext({table.number},0,""),2)

If the field is already a string, then use:

"<b>"+right({table.string,2)+"</b>"+"-"+mid({table.string},3,2)+"-"+left({table.string},2)

Place the formula on your report and then right click on the formula->paragraph formatting->text interpretation->HTML text.

-LB
 
lbass,

Thank you so much, the field was a string and the formula you provided worked beautifully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top