title: convert int to datetime in sybase
body: <p>This works perfectly on the server (sql server 2012) for a julian date of 5 digits</p>
  
  <pre><code>select cast (column1 as DATETIME) FROM mytable
  </code></pre>
  
  <p>How to cast an int to datetime in sybase?</p>
  
  <p>And which would be the best way, since I have a large table and I have to minimize the time i'm going to be using the server under the query.</p>
  
  <p>I saw here: <a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/sqlug645.htm" rel="nofollow">http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/sqlug645.htm</a> 
  that it is allowed to convert from <code>int</code> to <code>varchar</code> and from <code>varchar</code> to <code>smalldate</code>.</p>
  
  <p>So maybe something like this, but i don't know the syntax for sybase:
  declare @convDate varchar (200)</p>
  
  <pre><code>set @convDate = 'SELECT top 100 CONVERT( varchar (200), column1, 104 )as someCol FROM dbo.mytable'
  select cast (@convDate as DateTime) as newDate into #myTemp from ?
  </code></pre>