Predict the total count

  • bazzkar

    SSC Veteran

    Points: 270

    Comments posted to this topic are about the item Predict the total count

  • john.arnott


    Points: 11882

    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?

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    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
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Bob JH Cullen


    Points: 2082

    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.

  • Jinx-640161

    Ten Centuries

    Points: 1108


    Using UK regional settings my result was 1.

  • micniv

    Valued Member

    Points: 50

    Interesting question

    but the correct answer is ... 1

  • Peter Rijs

    Hall of Fame

    Points: 3400

    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

  • Christian Buettner-167247


    Points: 13729

    No comment, next question... 🙂

    Best Regards,

    Chris Büttner

  • selyod

    Valued Member

    Points: 59

    Grr. This returns 1 on my setup. Ah well.



    Points: 5519

    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.

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

  • Hugo Kornelis

    SSC Guru

    Points: 64685

    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.

    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog:
    SQL Server Execution Plan Reference:

  • SG Cowley

    Hall of Fame

    Points: 3460

    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.

  • ipounder


    Points: 1541

    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.

  • Andrea-227199

    SSC Rookie

    Points: 48

    Like selyod, with Italian settings (dd/mm/yyyy) this statement return 1

  • Toreador


    Points: 11257

    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 55 total)

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