title: Write generic SQL for both SQL Server and Oracle for displaying dates
body: <p>I do have to query SQL Server and Oracle DB for the same project.  The DBMS depends on the client, but the structure is exactly the same.</p>
  
  <p>For example, I do want to output dates without the "00:00:00" part, which is heavy and useless in a long output.</p>
  
  <p>Currently, I do have to edit the query each time:</p>
  
  <pre><code>SELECT col1, dated_requested_without_time, col3, col4, col5, *
  FROM table
  WHERE
      date_requested = CONVERT(varchar(10), GETDATE(), 120)
  --  date_requested = TRUNC(SYSDATE)
  </code></pre>
  
  <p>Is there a clever way to write it in a way that's executable in both environments without any editing needed?</p>
  
  <p>The goal is to display and compare against <strong>today's date</strong> (YYYY-MM-DD)...</p>
  
  <p>I did succeed to use concatenations like this</p>
  
  <pre><code>CONCAT(CONCAT(CONCAT(col1, ' '), col2), '.')
  </code></pre>
  
  <p>instead of the</p>
  
  <pre><code>col1 + ' ' + col2 + '.'      -- For SQL Server.
  col1 || ' ' || col2 || '.'   -- For Oracle.
  </code></pre>
  
  <p>for example. Hoping the same for the above date query…</p>
  
  <p>Any successful help would be greatly appreciated!</p>