|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 12:56 AM
Points: 2,475,
Visits: 2,133
|
|
sqlnaive (11/8/2012) This was a good question. I gave wrong answer or better to say incomplete answer (opted for only 4). Method 2 I was not sure because of code written was not complete.
from my perspective, losing 2 points is not a big deal than gaining small but important piece of knowledge. + 1
Still a good question though - maybe I took the supplied options a little bit too literaly
------------------------------- Posting Data Etiquette - Jeff Moden Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 7:39 AM
Points: 9,370,
Visits: 6,467
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:54 AM
Points: 7,086,
Visits: 7,138
|
|
My apologies to all for the incompleteness of option 2. Although I agree with "Arturius" though that it is pretty obvious what is missing and don't think it should have confused anyone, I'll ask Steve to correct it.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:54 AM
Points: 7,086,
Visits: 7,138
|
|
matthew.flower (11/8/2012) While I haven't tried them (have work to do) I am not convinced that any of them "work reliably" when you consider changes to and from daylight savings.
In the UK at least daylight savings changes happen at either 1am which becomes 2am or 2am which becomes 1am, so 2am back to midnight can be 1 hour or 3 hours at least once a year.
Unless I am missing something none of these methods convert both midnight and the current time to UTC before doing the difference between them so I would argue that the correct answer is none of them. You are absolutely correct. The wording needs to be changed to say "except on the days when daylight saving time begins or ends".
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Yesterday @ 10:50 PM
Points: 323,
Visits: 962
|
|
Koen Verbeeck (11/8/2012)
sanket kokane (11/7/2012) I got it wrong ...
you should mention sql server Version in question .
Sysdatetime () not present in sql 2000 and 2005So, for which versions do you think the question is meant? Obviously for 2008 and up. There's also a consensus that versions who are no longer supported by Microsoft do not count for Questions of the Day.
ohhh sorry .. I still have Bunch of servers running on 2000 
I will must say its nice question . Got to learn something new
----------------------------------------------------------------------------- संकेत कोकणे
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:45 AM
Points: 616,
Visits: 97
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 1:54 AM
Points: 7,086,
Visits: 7,138
|
|
Koen Verbeeck (11/8/2012)
Nice question Tom, but I doubt if I'll ever use it  (ps: you must be getting old if you can't count to four anymore  )
I am indeed getting old (although I can't seem to catch up with Ron), but I can still count four: zero, one, two, three . It's just that I sometimes forget to add one when I've counted something.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 10:27 AM
Points: 690,
Visits: 1,100
|
|
| This is absolutely the worse question I have encountered on QotD. Think I will pass on future Tom questions.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 7:32 AM
Points: 8,568,
Visits: 8,219
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 8:39 AM
Points: 1,045,
Visits: 218
|
|
| Good question, but I would question if a method is reliable if it does not work less than 1/3 of the time daily, method 2 overloaded at 8 am since this means that it would be only good during after midnight but only through early morning.
|
|
|
|