title: Invalid date format in datatype column in BODS job to Oracle
body: <p>I am using SAP BODS and I am trying to fetch data from an ORACLE server using SQL query transormation. Now The table has a column named latest_changed_date which is a datetime column. I only want yesterday and current day data from that table. Now since the column is datetime, I need to convert it to date, but when I am using to_date function I get the following error.</p>
  
  <pre><code>SELECT *
  FROM ABC.TEST
  WHERE TO_DATE(LATEST_CHANGED_DATE) = TO_DATE(SYSDATE-1)
  </code></pre>
  
  <p>The database error message is</p>
  
  <blockquote>
    <p>ORA-01843: not a valid month</p>
  </blockquote>
  
  <p>I tried giving date format in TO_DATE condition as below:</p>
  
  <pre><code>SELECT *
  FROM ABC.TEST
  WHERE TO_DATE(LATEST_CHANGED_DATE,'YYYY-MM-DD') &gt;= TO_DATE(SYSDATE-1,'YYYY-MM-DD')
  </code></pre>
  
  <p>Here I got the error:</p>
  
  <pre><code>date format picture ends before converting entire input string
  </code></pre>
  
  <p>I used trunc function also and again got either:</p>
  
  <pre><code>not a valid month
  </code></pre>
  
  <p>or </p>
  
  <pre><code>inconsistent datatypes: expected NUMBER got DATE
  </code></pre>
  
  <p>Below is a sample data for the column. I just need data for current and day before data from the column.</p>
  
  <p><a href="https://i.stack.imgur.com/uuBrE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uuBrE.png" alt="enter image description here"></a>  </p>
  
  <p>Update: I think the main issue is that I am not able to determine the proper datatype for the column in the source table and currently I don't have an option to determine that.</p>