title: Formatting date in YYYYMM format in DB2
body: <p>I am getting a date as a String from a table below in the format:</p>
  
  <pre><code>2014-09-02 
  </code></pre>
  
  <p>which is YYYY-MM-DD format. </p>
  
  <p>The query is:</p>
  
  <pre><code>SELECT VALUE FROM MYSCHEMA.MYTABLE WHERE CODE = 'MYDATE'
  </code></pre>
  
  <p>I want to modify above query so that the result is:</p>
  
  <pre><code>201402
  </code></pre>
  
  <p>I tried this, but not getting in correct format:</p>
  
  <pre><code>select char(year(date(value))) || char(month(date(value))) from MYSCHEMA.MYTABLE WHERE CODE = 'MYDATE'
  </code></pre>
  
  <p>The result is coming as:</p>
  
  <pre><code> 1            
  ------------ 
  2014       9 
  </code></pre>
  
  <p>I have db2 9.5 with me. </p>