Posted by David Portas on 08/23/07 22:40
"rdraider" <rdraider@sbcglobal.net> wrote in message
news:5_nzi.11029$3x.7225@newssvr25.news.prodigy.net...
> Correction the source field in an INT type
> So how to convert INT type YYYYMMDD to a date mm/dd/yyyy
>
>
DECLARE @dt INT;
SET @dt = 20070823;
SELECT CAST(CAST(@dt AS CHAR(8)) AS DATETIME) AS dt;
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
[Back to original message]
|