Let's say I have a bunch of part numbers, and I want a column to return the string after the first period and before the second period. I looked at other similar questions but couldn't figure it out
So let's say I have of list of part numbers such as:
10416.1.1.4
10416.1.1.7
10416.1.1.1
10416.2.3
10416.2.2
10416.3.1.2
10416.3.1.3
10416.4.1.1
10416.10.1
10416.10.2
10416.11.1.1
I should have my column return:
1
1
1
2
2
3
3
4
10
10
11
Using SQL Server 2012, thanks in advance
Edit: Here's my code, this returns a table but the sorting is all over the place, the PartNo column is what I'm trying to split
SELECT DISTINCT OrderDet.OrderNo, Scheduling.JobNo, OrderDet.PartNo,
OrderDet.Priority
FROM Scheduling LEFT JOIN OrderDet ON Scheduling.JobNo = OrderDet.JobNo
WHERE Scheduling.WorkCntr = 'Glazing'
ORDER BY OrderDet.Priority DESC