|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 11:54 AM
Points: 7,112,
Visits: 7,188
|
|
Nice question.
But 23:59:59.9999999 is rather easy to round to 100 microseconds, isn't it. So I'm surprised so many have it wrong.
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 10:27 AM
Points: 690,
Visits: 1,100
|
|
| Excellent question. I honestly had to run the code to get the correct answer but got a lesson on datetime2.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 12:39 PM
Points: 5,103,
Visits: 20,220
|
|
I am rather surprised at the low percentage of correct answers.
Correct answers: 37% (76) Incorrect answers: 63% (129) Total attempts: 205
And the implications this could have to those designing a DB, and inadvertently or deliberately using different definitions for a date time object in different tables (based only on each individual table's requirements) and then, when selecting, wondering why Select statements using a join / case / where on a date column do not return the correct data.
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please read Before posting a performance problem please read
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 3:28 AM
Points: 3,231,
Visits: 64,394
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: 2 days ago @ 4:59 PM
Points: 960,
Visits: 1,924
|
|
I'm really proud of me because instead of running the query, I went to SQL help to find out what where the 4 and 7 in the datetime2 declaration. I've learned something new in the correct way: putting attention, investigating, thinking and, only then, answering.
Luis C. Please don't trust me, test the solutions I give you before using them. Forum Etiquette: How to post data/code on a forum to get the best help
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: 2 days ago @ 11:36 AM
Points: 837,
Visits: 1,219
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:23 PM
Points: 415,
Visits: 2,333
|
|
bitbucket-25253 (8/2/2012)
I am rather surprised at the low percentage of correct answers. Correct answers: 37% (76) Incorrect answers: 63% (129) Total attempts: 205
And the implications this could have to those designing a DB, and inadvertently or deliberately using different definitions for a date time object in different tables (based only on each individual table's requirements) and then, when selecting, wondering why Select statements using a join / case / where on a date column do not return the correct data.
Speaking for myself, I'm relatively untroubled by missing questions like this. I always answer them based on what I know at the moment of answering, without testing in SSMS or googling. On the other hand, if I were using similar code in a project, I would actually test and research the situation. I doubt I'm the only one answering like that.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 4:48 PM
Points: 577,
Visits: 4,175
|
|
patrickmcginnis59 (8/2/2012)
bitbucket-25253 (8/2/2012)
I am rather surprised at the low percentage of correct answers. Correct answers: 37% (76) Incorrect answers: 63% (129) Total attempts: 205
And the implications this could have to those designing a DB, and inadvertently or deliberately using different definitions for a date time object in different tables (based only on each individual table's requirements) and then, when selecting, wondering why Select statements using a join / case / where on a date column do not return the correct data. Speaking for myself, I'm relatively untroubled by missing questions like this. I always answer them based on what I know at the moment of answering, without testing in SSMS or googling. On the other hand, if I were using similar code in a project, I would actually test and research the situation. I doubt I'm the only one answering like that.
But, but, but... the points you're missing out on...
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 11:49 AM
Points: 906,
Visits: 274
|
|
A most excellent question for content AND presentation.
+1
Cheers,
Steve
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:44 AM
Points: 596,
Visits: 501
|
|
patrickmcginnis59 (8/2/2012)
bitbucket-25253 (8/2/2012)
I am rather surprised at the low percentage of correct answers. Correct answers: 37% (76) Incorrect answers: 63% (129) Total attempts: 205
And the implications this could have to those designing a DB, and inadvertently or deliberately using different definitions for a date time object in different tables (based only on each individual table's requirements) and then, when selecting, wondering why Select statements using a join / case / where on a date column do not return the correct data. Speaking for myself, I'm relatively untroubled by missing questions like this. I always answer them based on what I know at the moment of answering, without testing in SSMS or googling. On the other hand, if I were using similar code in a project, I would actually test and research the situation. I doubt I'm the only one answering like that.
+1
Patrick, you are not the only one answering the QOTD this way. I also missed this one today.
Thanks for the question Bitbucket, and the reinforcement of the nuances of DateTime comparison.
------------- Brian Smith
|
|
|
|