Teradata Convert Integer to a timestamp
<p>I am trying to select data from a table that has a date range
Its a bit messy as its being passed from JAVA as an integer of the form 20160101 (YYYYMMDD)</p>

<p>So basically i want to be able to run a query like (incidentally this is the type of time stamp that works in the query)</p>

<pre><code>SELECT * FROM TABLE_A as t
WHERE t_timestamp &gt;='2016-10-01 00:00:00'
</code></pre>

<p>I have looked around on google and SO and have come up with something like this</p>

<pre><code>SELECT CAST(20161001 AS DATE FORMAT 'YYYY-MM-DD') || ' 00:00:00'
</code></pre>

<p>This is to try and convert the integer number to time stamp that will be acceptable as a date range. This doesn't appear to work. There is no error, just that results for when i statically add the time stamp exist vs when i try and make it general don't exist</p>

<p>Can anyone help?</p>