title: Get the last word of a part of a varchar (LEFT/RIGHT)
body: <p>What is the correct way to get the last word of a part of a varchar?</p>
  
  <pre><code>DECLARE @desc varchar(100)
  SET @desc='EXCHANGEUNIT P1i / SILVERBLACK/ CYRILLIC'
  
  SELECT RTRIM(LEFT(@desc, CHARINDEX('/', @desc) - 1))
  </code></pre>
  
  <p>This returns: <code>EXCHANGEUNIT P1i</code></p>
  
  <p>I need to get only <code>P1i</code> with the query. </p>
  
  <p>Thanks in advance.</p>