title: Common date format function for Oracle-sql and Mysql
body: <p>I need to write the common queries for MySQL and Oracle databases. Problem occurs when I have to put date conditions.
  For example: there is one field <code>Txn_date</code> which is in format of <code>'20150116'</code> in MySQL and <code>'16-JAN-2015'</code> in Oracle.</p>
  
  <p>I use <code>date_format(now(),'%Y%m%d')</code> for MySQL and <code>to_char(sysdate,'dd-MON-YYYY')</code> for Oracle.</p>
  
  <p>Is there any common function of way by which I can use the same function in both Oracle and MySQL?</p>
  
  <p>I tried <code>Txn_date in ( date_format(now(),'%Y%m%d') OR to_char(sysdate,'dd-MON-YYYY') )</code> but did not work because <code>to_char()</code> not recognized in MySQL.</p>