Date Functions

  • John Hanrahan

    Hall of Fame

    Points: 3825

    Comments posted to this topic are about the item Date Functions

  • Ford Fairlane

    SSCertifiable

    Points: 7664

    Nice question - thanks

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • Ken Wymore

    SSCoach

    Points: 16614

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

  • PRAMANA.DBA

    SSCertifiable

    Points: 5507

    Ford Fairlane (10/23/2013)


    Nice question - thanks

  • sqlnaive

    SSCoach

    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 https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Carlo Romagnano

    SSC-Insane

    Points: 21985

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

    I am really surprised!

    😛

  • sqlnaive

    SSCoach

    Points: 17435

    Good one Koen and Carlo... 🙂

  • paul s-306273

    SSChampion

    Points: 10615

    Nice built-in function.

  • call.copse

    SSCoach

    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

    SSC-Insane

    Points: 24681

    Nice one...

  • Richard Warr

    SSCertifiable

    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

    SSChampion

    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