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

Displaying string as xxxxxxxx5789 1

Status
Not open for further replies.

dev1212

Programmer
May 11, 2010
117
US
Hi,

I have a ticket number field which is string.
I want to display the last 4 digits only as xxxxxx5789.

I forgot how to format it.

Please reply..

Thanks
 
Try:

"xxxxxx"+right({table.string},4)

-LB
 
I tried it already but the thing is the length of the string is not constant. Sometimes the length of string is 10 sometimes 15 ...

Any other idea plz..
 
And then what would you want to happen? Do you want them all the same length? Or do you want to maintain the length?

-LB
 

The values are 'AD789733845789'
'XX344237777'
'4DWE87393DERTXTQ22'

So if i append 6 x's like you suggested
'xxxxxx'&Right({Customer.Number},4)

it will add 6 x's with last 4 digits.

As you can see the lengths of the string are different.

I need all 'x' with last 4 digits as
'xxxxxxxxxx5789'
'xxxxxxx7777'
'xxxxxxxxxxxxxxTQ22'

Thanks.. I appreciate your reply.


 
Change the formula to:

replicatestring("x",len({table.string})-4)+right({table.string},4)

-LB
 
Thanks.. dats exactly what i was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top