DATETIME - 3

  • As I post this, answer four has the lowest correct percentage of the four correct answers, an yet it is the only one without a valid alternative. Hmmmm ...

    Thanks Ron for the question. Had to get the cobwebs out and finish my breakfast before I clicked any answers. Learned the hard way about Monday morning questions.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Hugo Kornelis (3/11/2013)


    Good question on a feature that, hopefully, nobody ever relies on anymore. 🙂

    It always surpriseded me that anyone relied on it, except in early cobol programs where dates were strings and every byte counted. :sick: After all, 64 bit time - often represented as microseconds since 1900-01-01T00:00:00.000000, but sometimes 32-bit date (days) and 32-bit time (microseconds - a serious waste of 3 bits there :hehe:) - has been used in many languages since about 1968, so that string representations of dates were no longer a storage issue except for cobol programmers and those addicted to text strings for dates.

    Minor issues: it looks like the distracter options for value 1 and value 2 have been switched, and there was only one answer option for value 4.

    The switch of distractors maybe did no harm - it seems somewhat incredible, but to date 12% of people picked the distractor for value 1, apparently believing that a two digit year 49 could stand for a 4-digit year ending in 50, while only 9% picked the distractor for value 3 which required a far less bizarre mistake. But perhaps the craziest result is that 10% failed to get value 4 right although no wrong option was provided :w00t:, although that 5% could believe that two different values were both correct for value 1 is also rather surprising. :blink:

    Tom

  • Good one! Thanks for the Monday morning question that I was able to get correct.

  • Excellent question. I definitely learned something today.



    Everything is awesome!

  • Nice question. I didn't know about the cutoff year either.

  • Thanks for a great question Ron.

    I'm thinking about including a question like this in an interviewing process. Based on the current responses I think it could be very effective in separating those who know the subject from those who don't and also quite effective in separating those who are better at deduction and problem solving from those who are not so strong in that area.

    QotD's like this may be a great resource for putting together a quick and effective screening process! 😉

  • Dave62 (3/11/2013)


    Thanks for a great question Ron.

    I'm thinking about including a question like this in an interviewing process. Based on the current responses I think it could be very effective in separating those who know the subject from those who don't and also quite effective in separating those who are better at deduction and problem solving from those who are not so strong in that area.

    QotD's like this may be a great resource for putting together a quick and effective screening process! 😉

    I would hope most places and SQL server users don't use two-digit years. I know I had to look up this rule (didn't know it) because we only use 4 digit year everywhere. Seems like that should be a no brainer since the Y2K fiasco.

  • I thought everyone I work with only used 4 digit years until last week. I saw some code where they were using test values for date parameters with 2 digit years. It was a fairly new report query too so I can't chalk it up to someone being young and not knowing better. Luckily we don't deal with future dates beyond about a year from the current date. Still good to know the cutoff so that if an issue does arise, I'll know where to look first.

  • Dave62 (3/11/2013)


    I'm thinking about including a question like this in an interviewing process.

    I don't agree. I happened to know this one because I was already using SQL Server at the end of the previous century (wow, putting it like that really makes me feel old!) But how many people who started using SQL Server more recently would know this? I would be perfectly fine with employees who frankly admit that they'd have to look up (or experiment) to predict what SQL does with a two-digit year. And if I found someone who did know this, I'd still want to know if (s)he has been keeping up to date, or is still on knowledge of SQL 7.0 and SQL 2000 only.

    QotD's like this may be a great resource for putting together a quick and effective screening process! 😉

    Some QotD's could be used in an interview, but the large majority are more trivia-type questions and less about knowledge required for real-world SQL Server jobs.


    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/

  • Thanks for the question... brought back memories of the Y2K "feature"



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Hugo Kornelis (3/11/2013)


    Dave62 (3/11/2013)


    I'm thinking about including a question like this in an interviewing process.

    I don't agree. I happened to know this one because I was already using SQL Server at the end of the previous century (wow, putting it like that really makes me feel old!) But how many people who started using SQL Server more recently would know this? I would be perfectly fine with employees who frankly admit that they'd have to look up (or experiment) to predict what SQL does with a two-digit year. And if I found someone who did know this, I'd still want to know if (s)he has been keeping up to date, or is still on knowledge of SQL 7.0 and SQL 2000 only.

    QotD's like this may be a great resource for putting together a quick and effective screening process! 😉

    Some QotD's could be used in an interview, but the large majority are more trivia-type questions and less about knowledge required for real-world SQL Server jobs.

    Great point Hugo.

    There still may be some value in using QotD's like this one as interview questions because of the revelations about deductive reasoning and problem solving.

    I'm referring to the fact that there was only 1 option for Value 4 and still some failed to choose it. :hehe:

  • Hugo Kornelis (3/11/2013)


    Dave62 (3/11/2013)


    I'm thinking about including a question like this in an interviewing process.

    I don't agree. I happened to know this one because I was already using SQL Server at the end of the previous century (wow, putting it like that really makes me feel old!) But how many people who started using SQL Server more recently would know this? I would be perfectly fine with employees who frankly admit that they'd have to look up (or experiment) to predict what SQL does with a two-digit year. And if I found someone who did know this, I'd still want to know if (s)he has been keeping up to date, or is still on knowledge of SQL 7.0 and SQL 2000 only.

    I probably wouldn't use this exact question as I see no point in memorizing details you can look up, but I could see an interview question that tests to see if the candidate is at least aware of such issues when working with a two digit year.

  • Hugo Kornelis (3/11/2013)


    Dave62 (3/11/2013)


    I'm thinking about including a question like this in an interviewing process.

    I don't agree. I happened to know this one because I was already using SQL Server at the end of the previous century (wow, putting it like that really makes me feel old!) But how many people who started using SQL Server more recently would know this? I would be perfectly fine with employees who frankly admit that they'd have to look up (or experiment) to predict what SQL does with a two-digit year. And if I found someone who did know this, I'd still want to know if (s)he has been keeping up to date, or is still on knowledge of SQL 7.0 and SQL 2000 only.

    Maybe if response "I'm not sure how MSSQL treats two-digit years but I can look BOL" is OK.

    You are right, this behaviour is from a museum.



    See, understand, learn, try, use efficient
    © Dr.Plch

  • demonfox (3/11/2013)


    kapil_kk (3/11/2013)


    Hi,

    can someone plz explain it in a more simple manner..... explanation in QOTD is very inscrutable for me:cool:

    Inscrutable , is that the right word :ermm:

    well, as explained in the explanation ..

    1.

    The two digit year cutoff option specifies an integer from 1753 to 9999 that represents the cutoff year for interpreting two-digit years as four-digit years.

    So, for sql server to interpret Two digit year as Four digit year

    2.

    The default time span for SQL Server is 1950-2049,

    It means , if you anything in between the above range .. it will interpret as current century ..

    50 is 1950

    51 is 1951

    49 is 2049

    48 is 2048

    is that clear enough ??? 🙂

    I think Microsoft made its explanation of how the cutoff year functions more confusing by using the word "century". In my mind, and I suspect many others think the same way since this seems to be the most common usage, the word "century" denotes a 100-year period beginning on a year evenly divisible by 100, e.g. 1900 - 1999, 2000 - 2099. Thus, I might have decided that a two-digit year value of 65, being in the same "century" as the default cutoff year of 2049 (i.e., 2000-2099) would mean 2065.

    Microsoft could have made the explanation clearer by specifying that "a two-digit year value is interpreted as being within the 100-year period ending with the cutoff year." That would make it crystal clear to me that a cutoff year of 2049 means that two-digit year values will be deemed to represent years 1950 - 2049 while a cutoff year of 2074 would mean that two-digit year values will be deemed to represent years 1975 - 2074, etc.

    Jason Wolfkill

  • wolfkillj (3/11/2013)


    I think Microsoft made its explanation of how the cutoff year functions more confusing by using the word "century". In my mind, and I suspect many others think the same way since this seems to be the most common usage, the word "century" denotes a 100-year period beginning on a year evenly divisible by 100, e.g. 1900 - 1999, 2000 - 2099. Thus, I might have decided that a two-digit year value of 65, being in the same "century" as the default cutoff year of 2049 (i.e., 2000-2099) would mean 2065.

    Microsoft could have made the explanation clearer by specifying that "a two-digit year value is interpreted as being within the 100-year period ending with the cutoff year." That would make it crystal clear to me that a cutoff year of 2049 means that two-digit year values will be deemed to represent years 1950 - 2049 while a cutoff year of 2074 would mean that two-digit year values will be deemed to represent years 1975 - 2074, etc.

    Are you sure a century is 1900-1999? I think a century is 1901-2000.



    See, understand, learn, try, use efficient
    © Dr.Plch

Viewing 15 posts - 16 through 30 (of 37 total)

You must be logged in to reply to this topic. Login to reply