Use Different Text for Road Label (75 NOT I-75)

1814
3
05-24-2012 12:12 PM
KodyGoodwin
New Contributor
I am working with a shapefile for roads. In its attribute table the field 'ST_NAME' contains the road names. The problem is I only want to show numbers and not the letters preceding them. In the picture you can see the letters and numbers are within the shields. 

[ATTACH=CONFIG]14612[/ATTACH]

Is there a SQL query or definition query I could use to change the labels?
Tags (1)
0 Kudos
3 Replies
KodyGoodwin
New Contributor
Anybody please?
0 Kudos
MarcinGasior
Occasional Contributor III
In Label Expression type this expression:
Mid([ST_NAME], 4)

for pattern ST-XXX
and
Mid([ST_NAME], 3)

for pattern I-XX

Mid() function returns all characters starting from a number provided.
0 Kudos
StephenKruzik
New Contributor III
As long as every record has a "-" separating the road type, and the route number you could try this

In the label expression, check 'advanced' and paste the following

[HTML]Function FindLabel ( [ST_NAME] )
a = split( [ST_NAME] ,"-")
b = a(1)
FindLabel = b
End Function[/HTML]
0 Kudos