Re: number to datetime

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 01/15/05


Date: Sat, 15 Jan 2005 11:19:43 -0500

Gert-Jan Strik wrote:
> You missed one cast. Try
>
> select cast(cast(@int as char(8)) as datetime)
>
Yeah, I know. That's what I get for not testing.

-- 
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM" 


Relevant Pages

  • Re: DateTime, variants and double
    ... SQL Server stores them as paired integers - see BOL ... The table has a field of type DateTime which for various reasons I ... SELECT CAST AS FLOAT) ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: DateTime, variants and double
    ... The table has a field of type DateTime which for various reasons I ... SELECT CAST AS FLOAT) ... btw I'm using SQL Server 2000 and VC++ 6 ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: DateTime, variants and double
    ... The table has a field of type DateTime which for various reasons I ... SELECT CAST AS FLOAT) ... btw I'm using SQL Server 2000 and VC++ 6 ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: FSO.CreateTextFile UNC very slow
    ... > from the stored proc in MSSQL to a CSV but it is not really doing me ... > any good as the fields are CHAR type and would export with the ... CAST to cast the char values to varchar. ... This email account is my spam trap so I don't check it very often. ...
    (microsoft.public.scripting.vbscript)
  • Re: Picking out top three out of database
    ... > Yeah, IŽll think of that next time around, but back to the thing here. ... > So how one use this TOP modifier? ... generates the SQL for you. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.general)