SELECT
LastPOIndex = CHARINDEX('PO', OrderString, CHARINDEX('PO', OrderString) + 2),
OrderNumber = CASE
WHEN CHARINDEX('PO', OrderString, CHARINDEX('PO', OrderString) + 2) > 0 THEN
SUBSTRING(OrderString, CHARINDEX('PO', OrderString, CHARINDEX('PO', OrderString) + 2) + 2, 12)
ELSE
NULL
END
FROM Orders;