November 4, 2010 at 9:34 pm
Comments posted to this topic are about the item Predict the total count
November 4, 2010 at 9:45 pm
Or, if your locality sets the date format as dd/mm/yyyy, then would not the 01/07/2010 row be saved as first of July? That would seem to still result in two matches.
But, are there other national settings that might give a different result?
November 5, 2010 at 1:52 am
Nice question, but since this is an international website, it was better to include some information about the server settings of the set-up. Or include some statements like SET DATEFORMAT.
I ran a small test, and if you include the statatement SET DATEFORMAT dmy; at the beginning of the script, the result is 1.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 5, 2010 at 2:11 am
The question asks us to 'predict' the outcome, which implies you do it by inspection. But how is anyone supposed to know that 40358 is a relevant date serial?
Poorly constructed question, I'd say.
November 5, 2010 at 2:11 am
Hi,
Using UK regional settings my result was 1.
November 5, 2010 at 2:12 am
Interesting question
but the correct answer is ... 1
November 5, 2010 at 2:28 am
I agree with Bob: how should we know which date 40358 is, without executing a command?
Poor question, poor explanation as well (as pointed out in some other reactions).
Peter Rijs
BI Consultant, The Netherlands
November 5, 2010 at 2:31 am
No comment, next question... 🙂
Best Regards,
Chris Büttner
November 5, 2010 at 2:47 am
Grr. This returns 1 on my setup. Ah well.
November 5, 2010 at 2:50 am
Yes, there are different cultures with different dateformats. Not only strange countries from the east of Europe!
The different order in writing dates in UK and USA was used as a clue by lord Peter Wimsey. I don't rememeber the name of that story.
November 5, 2010 at 2:53 am
Terrible question. The only correct answer is "it depends", and that answer was missing.
If the default language of your server happens to be, for example, British English, you'll get 1 as your answer. Same for German, Dutch, French, and several other languages.
Add this to the fact that it's impossible to know what date the number 40358 represents, and you get a question that is impossible to answer without running the code, and even after running it leaves you with a choice between two answers.
(I used an educated guess - in my experience, over 90% of the code that does not cater for international use comes from the US, so I picked the answer I got when using SET LANGUAGE us_english)
Please do submit more questions in the future - but not of this quality.
November 5, 2010 at 3:17 am
Both 1 and 2 are the correct answer depending of the Dateformat set!. As others has said a poor question unless we have SET DATEFORMAT at the start.
November 5, 2010 at 3:20 am
Poor US-centric question. The answer is dependent upon the cultural settings of your server.
Remember the rest of the world does not share this irrational date format. We on the whole use either day/month/year or year/month/day. Plus how is anyone supposed to know what date 40358 relates to without running a query?
See me after class - must try harder.
November 5, 2010 at 3:25 am
Like selyod, with Italian settings (dd/mm/yyyy) this statement return 1
November 5, 2010 at 3:32 am
Even ignoring the date format problem, what is this question supposed to teach us? Why would anyone want to convert a date to a float?
Viewing 15 posts - 1 through 15 (of 54 total)
You must be logged in to reply to this topic. Login to reply