Posted By

mprabhuram on 08/20/10


Tagged

Oracle


Versions (?)

Logic to subtract months from a date field and extract run_yr_mo


 / Published in: SQL
 

Logic to subtract months from a date field and extract year and month

  1. SELECT TO_CHAR(ADD_MONTHS(TO_DATE(TRIM('02/09/2010'),'MM/DD/YYYY'),-3),'YYYYMM')
  2. FROM dual;
  3.  
  4. Result : 200911

Report this snippet  

You need to login to post a comment.