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

Add hyphen to a number 2

Status
Not open for further replies.

tkschief

MIS
Apr 20, 2006
28
US
Hi,

I'm using CR 11 and I cannot figure out how to format a number field to include a hyphen after the first 2 digits in the number. Is this possible?

For example, T_CASE_INCIDENT.INCIDENT_ID displays as 1001281 in my report. I need it to display as 10-01281.

Thanks for any help you can provide!

T
 

You'll end up with a text value, not a number:

left(totext({yourfield},"#",0),2) + "-" + right(totext({yourfield},"#",0),len(totext({yourfield},"#",0))-2)

 
If the number is always the same length, another solution would be:

picture(totext({table.number},0,""),"xx-xxxxx")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top