Date Functions

  • Comments posted to this topic are about the item Date Functions

  • Nice question - thanks

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

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

  • Ford Fairlane (10/23/2013)


    Nice question - thanks

  • 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. 🙂

  • I spotted at least 3 correct answers 😀

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

    I am really surprised!

    😛

  • Good one Koen and Carlo... 🙂

  • Nice built-in function.

  • 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

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

    Nice question....

  • Nice one...

  • 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

  • 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