April 13, 2011 at 1:29 am
Thank you very much for this beautiful qotd.
It's unbelievable, but true, only new types DATE and DATETIME2 work in any case.
April 13, 2011 at 1:51 am
Dammit, I got it wrong because I've misread the question.
Anyway, it was a great question, thanks Duncan.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 13, 2011 at 2:49 am
good Question
Malleswarareddy
I.T.Analyst
MCITP(70-451)
April 13, 2011 at 3:06 am
Nakul Vachhrajani (4/13/2011)
Duncan Pryde (4/13/2011)
Nakul Vachhrajani (4/13/2011)
Thank-you, Duncan for this wonderful series!You're welcome - although I'd hesitate to call 2 questions a series! Unless you're expecting more? :blink:
Definitely expecting more 🙂 Maybe I like them because a few years ago, we made major changes to our product to support globalization/internationalization and came across all these issues then. These QotDs are great learning opportunities for anyone who would want to work on a product that would work no matter where you take it.
Thank you for these questions Duncan! And I am also expecting more :-).
Cheers
April 13, 2011 at 3:09 am
Great question perfectly worded. It was quite clear that dateformat was relevant to the question and that you were looking for only the 2 statements that would work under all conditions. I hate the pedantics on here.
However, without 2008 to play on, and after much unsuccessful digging around with google, I ended up guessing wrong. Bummer!
Learned something new though, which is always the primary objective 🙂
Keep them coming Duncan.
_____________________________________________________________________
[font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]
April 13, 2011 at 5:48 am
Henrico Bekker (4/13/2011)
question doesnt state that you need to SET LANGUAGE....
Look closer... (bolded emphasis mine)
Which of the following statements will complete successfully - i.e. not cause an error - in SQL Server 2008, regardless of any date format or language settings?
This is a good question... thanks!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 13, 2011 at 6:32 am
D'oh! After I'd submitted my answer I realised I'd ticked the two that triggered the error, NOT the two that would complete successfully...my reading comprehension clearly needs work. :crying:
April 13, 2011 at 6:48 am
I definitely learned something this morning, thanks.
April 13, 2011 at 7:14 am
Koen Verbeeck (4/13/2011)
Dammit, I got it wrong because I've misread the question.Anyway, it was a great question, thanks Duncan.
Know the feeling - note to self - read the question at least twice !
-------------------------------Posting Data Etiquette - Jeff Moden [/url]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
April 13, 2011 at 7:22 am
A good question. As of 9:20 AM only 28 percent correct answers.
Your QOD has achieved one of the major objectives ... teaching
April 13, 2011 at 7:37 am
Great question. Not sure how some people can argue the clarity. Waterford crystal isn't any clearer than this question. Keep 'em coming Duncan.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 13, 2011 at 7:39 am
bitbucket-25253 (4/13/2011)
A good question. As of 9:20 AM only 28 percent correct answers.Your QOD has achieved one of the major objectives ... teaching
Thanks - although I'd have hoped the percentage of correct answers would have been considerably higher given the answers were in the links I'd posted as part of the explanation of last week's question. But then it looks like some people are getting it wrong because they misread the question, not because they didn't know the answer.
Maybe I will need to revisit this topic in another QotD :blink:
April 13, 2011 at 7:52 am
Carlo Romagnano (4/13/2011)
Thank you very much for this beautiful qotd.It's unbelievable, but true, only new types DATE and DATETIME2 work in any case.
Which is exactly why I got this right -- I knew that SMALLDATETIME has limits and I thought I remembered that DATETIME had problems, so it made sense that only the two new datatypes would do British without error.
April 13, 2011 at 7:58 am
Duncan Pryde (4/13/2011)
bitbucket-25253 (4/13/2011)
A good question. As of 9:20 AM only 28 percent correct answers.Your QOD has achieved one of the major objectives ... teaching
Thanks - although I'd have hoped the percentage of correct answers would have been considerably higher given the answers were in the links I'd posted as part of the explanation of last week's question. But then it looks like some people are getting it wrong because they misread the question, not because they didn't know the answer.
Maybe I will need to revisit this topic in another QotD :blink:
Given how many people seem completely oblivious to the impact that collation and language settings have upon how date functions work, I think it would be very useful to the community. Looks like lots of people assume that because it works on US settings it would work anywhere in the world.
April 13, 2011 at 8:08 am
Duncan Pryde (4/13/2011)
bitbucket-25253 (4/13/2011)
A good question. As of 9:20 AM only 28 percent correct answers.Your QOD has achieved one of the major objectives ... teaching
Thanks - although I'd have hoped the percentage of correct answers would have been considerably higher given the answers were in the links I'd posted as part of the explanation of last week's question. But then it looks like some people are getting it wrong because they misread the question, not because they didn't know the answer.
Maybe I will need to revisit this topic in another QotD :blink:
Indeed, definitely post another QOD concerning dates and time. if memory serves me correctly, last weeks percent correct was about 28 so it is an area that needs more teaching.
Viewing 15 posts - 16 through 30 (of 58 total)
You must be logged in to reply to this topic. Login to reply