August 16, 2016 at 9:04 pm
Comments posted to this topic are about the item The Max datetime
August 16, 2016 at 11:19 pm
Need a correction in the original question. It shouldn't be "datetime". It should be "smalldatetime", just to avoid confusion that seems to be leading to a rather large base of people selecting the incorrect answer.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 16, 2016 at 11:43 pm
A datetime allows the time component to be 23:59:59.
Because the question asks for the maximum time stored by a datetime value and not a smalldatetime, I believe a change to the question is required.
Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Follow me on
Twitter: @sqltwins
August 17, 2016 at 12:11 am
Got confused between datetime and smalldatetime...!!! But easy question and a good learning.!!
Thanks
August 17, 2016 at 12:38 am
This was removed by the editor as SPAM
August 17, 2016 at 3:09 am
Nakul Vachhrajani (8/16/2016)
A datetime allows the time component to be 23:59:59.
But it also allows the date component to be up to 9999-12-31, so none of the answers would be correct if you assumed that datetime was the type being tested. I agree, the question is poorly worded, but it's possible to figure out the author's intent fairly easily.
August 17, 2016 at 5:39 am
Like Paul pointed out, the question asks about the max of a datetime. Given the answers provided, it wasn't too hard to figure out. Sure, it's an inaccurate question, but how many inaccurate questions do we get from people in a day during work? 😛
August 17, 2016 at 6:22 am
I have to agree about the question wording (because we all like to whine from time to time). However, I did realize that the question was about SmallDateTime. I got it wrong because I forgot about the rounding for seconds. So, a re-learning experience and I'll take my punishment for the miss.
August 17, 2016 at 6:26 am
The wording " What's the maximum time that can be stored in SQL Server 2014?" got me. :angry:
But logically speaking, isn't it the interval from zero to 2079-06-06 23:59:00
the maximum value of the TIME in seconds that can be STORED in SS2014?
They haven't it always easy, our authors of QotD... 😉 Thanks Steve, need more coffee...:-)
August 17, 2016 at 6:47 am
Like everyone has already noted, typo on the datetime; should be smalldatetime.
August 17, 2016 at 6:49 am
I played around with it a bit.
I can stuff '20790606 23:59:29' into a smalldatetime variable and it comes back out as '20790606 23:59:00'
If I put '20790606 23:59:30' into it then it errors.
August 17, 2016 at 8:26 am
Thank you for the post, Steve, good one.
I see a small mistake.:-)
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
August 17, 2016 at 12:30 pm
Adding one more vote to the request for correction.
August 17, 2016 at 4:27 pm
Sorry, corrected the question itself. Too used to writing "datetime".
August 18, 2016 at 8:11 pm
I also don't use Datetime as it's not accurate enough. I use Date , Time & Datetime2 as these correspond to my other Database that I use ( DB2 ) which has Date , Time and Timestamp
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply