Found it! New Code: Substr ( tostring(BusinessUnitNum) , 8 , 4 ) -- View this message in context: http://www.nabble.com/Using-Rpad-to-trim-long-number-tp18451024p18451122.html Sent from the MapGuide Users mailing list archive at Nabble.com.