Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 reverse substr extract 2 digits or chars from righ
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

567 Posts

Posted - 12/27/2012 :  17:44:48  Show Profile  Reply with Quote
Can you please provide reverse sub string capturing from right 2 charecters/digits:

it can be 5 digit or 6 digit data, want to capture the right side 2 digits.

example: 72509

after extract: it should be: 09 , 10

Thank you very much for the helpful info.

Edited by - cplusplus on 12/27/2012 17:48:03

Flowing Fount of Yak Knowledge

2875 Posts

Posted - 12/27/2012 :  18:05:36  Show Profile  Reply with Quote
You can just grab the last 2
SELECT RIGHT(digits,2) or if digits is a number
SELECT RIGHT(convert(varchar(6),digits),2)


Everyday I learn something that somebody else already knew
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000