Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
DECLARE @Table TABLE(Date DATETIME)INSERT INTO @Table SELECT 2010351 --This date actually is 17/12/2010SELECT * FROM @TableOutput--------2010-12-17 00:00:00:0000However, i do not wanted to change the insert statement, therefore is there any way to do conversion at the table?
Sachin.Nand
2937 Posts
Posted - 2010-12-18 : 02:46:50
This?
SELECT DATEADD(dd,CAST(RIGHT(2010351, 3) AS Integer) - 1,DATEADD(yy,CAST(LEFT(2010351, 3) AS Integer),0))