home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,663 of 19,505   
   Plamen Ratchev to All   
   Re: how to convert int to datetime   
   06 Oct 09 19:36:23   
   
   15e8f691   
   From: Plamen@SQLStudio.com   
      
   That means that some values are invalid dates. Try this:   
      
   SELECT CASE WHEN ISDATE(CAST(LDate  AS CHAR(8))) = 1   
                THEN CAST(CAST(LDate  AS CHAR(8)) AS DATETIME)   
           END   
   FROM dbo.Schedules;   
      
   --   
   Plamen Ratchev   
   http://www.SQLStudio.com   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca