title: Get nth word in a string delimited by "."
body: <p>Already have the query to get the first word delimited by ".", I need a new column that displays the 3rd word</p>
  
  <pre><code>SELECT   
      MyColumn, 
      LEFT(MyColumn, CHARINDEX('.', MyColumn) - 1) AS [1st Sequence]
  FROM    
      dbo.MyTable
  </code></pre>
  
  <p>Sample #1: </p>
  
  <pre><code>2345.Z2Z2.A12151.AB4R
  </code></pre>
  
  <p>Query should return <code>A12151</code></p>
  
  <p>Sample #2: </p>
  
  <pre><code>STR4.35S982F.X24
  </code></pre>
  
  <p>Query should return <code>X24</code></p>
  
  <p>EDIT:</p>
  
  <p>Thanks everyone for sharing your queries. Although the WITH CTE worked, I'm thinking of a simplier query since this will be used as a datasource to my dropdownlist and will always refresh when another dropdownlist changes.</p>
  
  <p>I think this can be done by SUBSTRING. Please see below a query I've found and tested which extracts the 2nd word. I'm currently modifying this to extract the 3rd word. If anyone could help me with this, I would be very greatful:</p>
  
  <pre><code>SELECT MyColumn,
  SUBSTRING(MyColumn, CHARINDEX('.', MyColumn) + 1 , CHARINDEX('.', MyColumn, CHARINDEX('.', MyColumn)+1) - (CHARINDEX('.', MyColumn) + 1))
  FROM dbo.MyTable
  </code></pre>