title: Tricky use of substring
body: <p>My question is about a field called contract_nm varchar2(14). I need to get 3 different values from it use the field to get the filter for a where clause.</p>
  
  <p>Here is the sample data and how long the data might be, either 9 or 10 or 11, no more for now it can be.</p>
  
  <pre><code>CONTRACT_NM               LENGTH(CONTRACT_NM)
  F.US.WZ10                          9
  F.US.WZ11                          9
  F.US.WZ12                          9
  F.US.RBZ10                         10
  F.US.RBZ11                         10
  F.US.RBZ12                         10
  F.US.ZWAZ10                     11
  F.US.ZWAZ11                     11
  F.US.ZWAZ12                     11
  etc
  </code></pre>
  
  <p>1)      I need to display the last 3 characters of contract_nm.</p>
  
  <p>2)      Check the last 3 characters of contract_nm to see if the first letter is one of the below, then it would be that MONTH and the YEAR would be the next 2 letters and the DAY would be defaulted to the first day of the month. I need to display like a date because it is going into a date field.</p>
  
  <pre><code>Trade Months (Terms):
  F              January                                
  G             February                              
  H             March                   
  J              April                       
  K             May
  M       June                           
  N             July
  Q             August
  U             September
  V             October
  X             November
  Z       December
  </code></pre>
  
  <p>3)      This is a bit difficult to explain in writing, I will try and hope you understand me!!! Read contract_nm data, ignore the first five  characters (F.US.), then ignore the last 3 characters i.e. Z11. Now, what we are working with is either 1 character (9 length) or 2 characters (10 length) or 3 characters (11 length) of data in the middle, always, see the below data. If 1 character, then display that letter, else if 2 characters, then check the 2nd letter if is not ‘E’ or ‘A’ or ‘T’ then display both letters, else display just the 1st letter.  Else if 3 characters, then display the first 2 letters.</p>
  
  <p>4)      I need a filter for my where clause to read contract_nm data, ignore the first five  characters (F.US.), then ignore the last 3 characters i.e. Z11. Now, what we are working with is either 1 character (9 length) or 2 characters (10 length) or 3 characters (11 length) of data in the middle, always, see the below data. If 2 characters, then check the 2nd letter if is not ‘E’ or ‘T’ then don’t pull the data, else do it. Else if 3 characters, then check the 3rd letter if is not ‘E’ or ‘T’ then don’t pull the data, else do it.</p>