THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » Teaser » dates   (RSS)
  • Yet Another Date Teaser

    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 ...
    Posted to Denis Gobo (Weblog) by Denis Gobo on January 10, 2008
  • SQL Teaser: Guess the output

    What do you think will be the output? DECLARE @d datetime SET @d = '20071010' SELECT DATEADD(yy, DATEDIFF(yy, 0, @d)+1, -1)
    Posted to Denis Gobo (Weblog) by Denis Gobo on October 10, 2007
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement