Sunday, December 28, 2014

Get Revision Number From A Varchar Column

As per your posted sample data this would work



SELECT STUFF(Order_Number,1,PATINDEX('%[0-9]%',Order_Number + '0')-1,'') AS RevisionNumber
FROM Orders
WHERE Order_Number LIKE '%R%'





Please Mark This As Answer if it solved your issue

Please Vote This As Helpful if it helps to solve your issue

Visakh

----------------------------

My Wiki User Page

My MSDN Page

My Personal Blog

My Facebook Page


No comments:

Post a Comment