|
|
|
|
Browse by Tags
All Tags » Teaser » dates (RSS)
-
It has been a while since my last teaser but here we go
What do you think the following returns?
SELECT CONVERT(datetime,'1/1/1') -CONVERT(datetime,1) + CONVERT(datetime,0)
How about this on SQL Server 2008
SELECT CONVERT(datetime2,'1/1/1'),CONVERT(datetime2,'01/01/01'),CONVERT(datetime2,'0001/01/01')
Now run this on SQL Server ...
-
What do you think will be the output? DECLARE @d datetime SET @d = '20071010' SELECT DATEADD(yy, DATEDIFF(yy, 0, @d)+1, -1)
|
|
|
|
|