• Nice question, Ron!

    I only got it right because I figured that the relative order of the date and time related values would be "logical". And since the conversion to smalldatetime would chop off the seconds and the conversion to date the entire time portion, the only logical ordering of those three would be date / smalldatetim / datetime. So I knew that I was looking for an answer where the number 2 was before 3, and 3 before 5 - with the other two numbers at any possible location.

    My luck was that there was only one solution left after applying this filter! 😉

    PS: Is the "weird" order of the colB values accidental, or a deliberate ploy to make the question even harder?


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/