/ Published in: SQL
                    
                                        
Logic to subtract months from a date field and extract year and month
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
SELECT TO_CHAR(ADD_MONTHS(TO_DATE(TRIM('02/09/2010'),'MM/DD/YYYY'),-3),'YYYYMM')
FROM dual;
RESULT : 200911
Comments
 Subscribe to comments
                    Subscribe to comments
                
                