Dating for DBAs

  • Good question. Being in London (where we speak a 'foreign' version of English) helped to get it right.:-)

  • Hugo Kornelis (4/6/2011)


    Few, I would hope 😉

    Actually, the ODBC format can be quite useful when you are developing a system fetching data in may different data sources, as you can unify the way you write you dates in your queries. But beside that type of usage, I agree it's probably best to use another syntax.

  • Excellent question. Got it wrong - but learned a lot.:-)

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan

  • I'm glad people are liking the question - thanks for the positive comments everyone.

    I was motivated to come up with the question after following a discussion relating to a QotD from a few weeks ago. There was some (at times quite heated!) debate around language-independent date formats, so I thought it would be good material for a question, and hopefully some more discussion.

    Incidentally, there's a "second date" scheduled to be published next week, so anything you read in those links could be handy... 😎

  • paul.knibbs (4/6/2011)


    Pity you can't split the results by nationality--I wonder how many British or European DBAs would get this one wrong? 🙂

    I'll admit that I deliberately chose '04-28-2011' as a potential answer rather than '28-04-2011', but this was more because I reckoned there might be more people using the first format in their daily lives, rather than being a deliberate attempt to target our friends across the pond. Honest.

  • This was a great question. I got it wrong but appreciate the information. Thanks!

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • cdiebolt (4/6/2011)


    Add one more european developer! 😉

    I didn't know that the 2nd answer is dateformat dependent. :Whistling:

    Me either... I was pretty sure 2011-04-28 was a dateformat neutral date... 🙁

    Just a silly ANSI standard, but not dateformat neutral... :/

    Of course I missed the hint (select 2)... which might have helped.



    --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]

  • UMG Developer (4/5/2011)


    CirquedeSQLeil (4/5/2011)


    UMG Developer (4/5/2011)


    How many people actually use the ODBC date literals?

    I think very few in comparison.

    Yeah, I think the number of people answering correctly shows that. (Currently 33% of the 24 people that have answered.)

    I would have to agree that using the ODBC date literals is "Old School" in a bad way.

    I had a project back in the late 90's that had to show dates in Cannadian and US format.

    We used the second format to transfer the dates as strings from the UI to SQL and back.

    This yyyyddmm string format tested on SQL 7 and SQL 2000 as being 50% faster during a load.

    I tested today when I saw the question and it still round trip faster to format the date as string in the yyyyddmm format and pass to SQL for Multilaguage and Multiformat support. Formating as string YYYY-dd-mm and doing a cast using ODBC date literals just takes longer.

  • Great question. Love the title.

  • paul.knibbs (4/6/2011)


    Pity you can't split the results by nationality--I wonder how many British or European DBAs would get this one wrong? 🙂

    I would bet it is a greater percentage than US dba's.

    Many US dba's and database developers have worked on at least one project with Canadian customers. They use the dd-mm-yyyy data format. :smooth:

    It is my understanding the all of Great Briton uses the same date format.

  • Excellent question. Got it wrong though, but learned something new today.

    Thanks,

    Suresh

  • Duncan Pryde (4/6/2011)


    I'm glad people are liking the question - thanks for the positive comments everyone.

    I was motivated to come up with the question after following a discussion relating to a QotD from a few weeks ago. There was some (at times quite heated!) debate around language-independent date formats, so I thought it would be good material for a question, and hopefully some more discussion.

    Incidentally, there's a "second date" scheduled to be published next week, so anything you read in those links could be handy... 😎

    OK, Duncan, I got this wrong, and I'm the one who posted the link last week to Tibor Karaszi's excellent write-up!:ermm:

    I don't use the {} ODBC escape format, so I missed that one. Guess I learned something, so thanks.

    Rich

  • Terrific question. For some reason dates are not my best topic.

    The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking

  • Duncan Pryde (4/6/2011)


    I'm glad people are liking the question - thanks for the positive comments everyone.

    I was motivated to come up with the question after following a discussion relating to a QotD from a few weeks ago. There was some (at times quite heated!) debate around language-independent date formats, so I thought it would be good material for a question, and hopefully some more discussion.

    Incidentally, there's a "second date" scheduled to be published next week, so anything you read in those links could be handy... 😎

    I remembered that discussion and got the answer correct as a result! (I knew enough to test these possibilities out in SSMS with language set to British and then to French because I knew they would probably all work with my current setting of US English.) Two points is a good reward for reading, retaining, and applying information introduced in QOTD discussions.

  • rmechaber (4/6/2011)


    Duncan Pryde (4/6/2011)


    I'm glad people are liking the question - thanks for the positive comments everyone.

    I was motivated to come up with the question after following a discussion relating to a QotD from a few weeks ago. There was some (at times quite heated!) debate around language-independent date formats, so I thought it would be good material for a question, and hopefully some more discussion.

    Incidentally, there's a "second date" scheduled to be published next week, so anything you read in those links could be handy... 😎

    OK, Duncan, I got this wrong, and I'm the one who posted the link last week to Tibor Karaszi's excellent write-up!:ermm:

    I don't use the {} ODBC escape format, so I missed that one. Guess I learned something, so thanks.

    Rich

    Hi Rich - I couldn't remember who it was who'd posted the link, but after dipping into it a few times and reading the BOL page, a couple of questions came to mind - so thanks for sowing the seed!

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

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