Date Functions

  • John Hanrahan

    Hall of Fame

    Points: 3825

    Comments posted to this topic are about the item Date Functions

  • Ford Fairlane


    Points: 7664

    Nice question - thanks

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • Ken Wymore


    Points: 16614

    Nice, easy one. I'm surprised this function hadn't come up in a question before now.



    Points: 5507

    Ford Fairlane (10/23/2013)

    Nice question - thanks

  • sqlnaive


    Points: 17435

    Great QOTD. Why ? because i've yet to work on SQL 2012 and these sorts of questions help me getting familiar with new useful functionalities. Keep it up John. 🙂

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    I spotted at least 3 correct answers 😀

    Need an answer? No, you need a question
    My blog at
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Carlo Romagnano


    Points: 21985

    Till now "Ask a co-worker?" is 0%.

    I am really surprised!


  • sqlnaive


    Points: 17435

    Good one Koen and Carlo... 🙂

  • paul s-306273


    Points: 10615

    Nice built-in function.

  • call.copse


    Points: 17201

    Didn't know this was in SQL, had only seen it in Excel, may be useful (we might upgrade to 2012 in 2021 or so!). I've always used 'Take the first day of next month and subtract a day' before.

  • This was removed by the editor as SPAM

  • Bangla

    Hall of Fame

    Points: 3137

    The option "Ask a co-worker?" was excellent....:-)

    Nice question....

  • Anipaul


    Points: 24681

    Nice one...

  • Richard Warr


    Points: 6957

    I was hunting for the option which said

    Recite the rhyme:

    30 days hath September,

    April, June and November,

    All the rest have 31,

    Excepting February alone.

    Which has but 28 days clear

    And 29 in each leap year

    to yourself

    but then decided that particular choice was common across all releases of SQL Server.

    So I went with the 2012-specific one.

    MCSA SQL Server 2012

  • Toreador


    Points: 11257

    For me, a better answer is to subtract one from the first day of the next month, as this method will allow the same code to be run on other versions of SQLServer. The EOMONTH function is of no use if you are writing a system that has to run on SQL2008 as well.

Viewing 15 posts - 1 through 15 (of 36 total)

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