This should get you what you need. Just put in your column name where I have the string literal.
select reverse(cast(cast(reverse(substring('05380101010000', 8, 4)) as int) as varchar(4)))
Edit: And, of course, we both post the solution at the same time. 🙂
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon