EOMONTH - 1

  • Comments posted to this topic are about the item EOMONTH - 1

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thanks Ron

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks Ron for another one on SS 2012!

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Thanks Ron .

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Easy one, thanks 🙂

    I selected the answers one could expect, because it would be pretty sad if they messed up a brand new function 😀

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

  • Lokesh Vij (1/20/2013)


    Thanks Ron for another one on SS 2012!

    +1

    [font="Verdana"]Regards,
    Rals
    [/font].
  • 😉 good one.

    (.. i didn't know the existence of EOMONTH till now; and the functions in the SQL mainly turn to pink color font by default, by seeing the T-SQL code initially felt like is this a trick question? and literally did the BOL search and yes.... there you are... 🙂 and understood that the IFCodes needs updating to the 2012 keywords... 😀 )

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • This question is better suited for http://www.GeographyCentral.com.

    How does knowing the last day of February in 2016 have anything to do with SQL Server? I had to check a calendar in order to answer this question, books online was no good here.

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • This was removed by the editor as SPAM

  • Stewart "Arturius" Campbell (1/21/2013)


    Good qurstion, Ron,

    Thanks

    Sean Pearce (1/21/2013)


    This question is better suited for http://www.GeographyCentral.com.

    How does knowing the last day of February in 2016 have anything to do with SQL Server? I had to check a calendar in order to answer this question, books online was no good here.

    Point of note:

    The EOMONTH function in Excel currently does not recognise leap years. Therefore, if this was an exact copy of the function as used in Excel, it would not work correctly.

    Since when did SQL Server start copying Excel?

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • Sean Pearce (1/21/2013)


    Since when did SQL Server start copying Excel?

    Since SQL Server 2012 apparently 😉

    Other functions "stolen" from other languages: choose, iif, format and concat

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

  • Sean Pearce (1/21/2013)


    Since when did SQL Server start copying Excel?

    It didn't (at least not the buggy version of the code that was distributed in Excel 97 and Excel 98 for Macintosh). But in SQL Server 2012, there are definitely a lot of new function that are totally useless - except if you want to enable an easier transition from VBA and Access SQL to T-SQL. EOMONTH is one of them, IIF is a very clear example, and I think there were a few more, but I don't have the time to hunt them all down now.


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

  • Hugo Kornelis (1/21/2013)


    EOMONTH is one of them, IIF is a very clear example, and I think there were a few more, but I don't have the time to hunt them all down now.

    I listed them at the same time you posted 😀

    (apparently I do have the time to hunt them all down down :w00t:)

    Most of the new TSQL functions are usability functions, in the sense that you could achieve the same in earlier versions of SQL Server, but with a more clever use of existing functions, such as dateadd.

    Notable exceptions are OFFSET and FETCH, and the new windowing functions, which are awesome by the way.

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

  • Good to see another 2012 question. I hadn't read about Eomonth before, so had to read a BoL page and learn something new. 😎

    It's mildly irritating though, having to work out what days of the week are 29 Feb 2016 and 31 Dec 2016 - the sort of thing that would tempt me to run the code if the version of of SQL Server I have (2008 R2) included Eomonth. 😉

    edit: Like Koen, I assumed that the new function wouldn't be screwed up - after all, the date handling in earler versions recognised leap years OK, why would this new function in 2012 be different? (I wasn't aware of teh EXCEL function - so maybe that was an easier choice for me than for Koen :-D).

    Tom

  • Sean Pearce (1/21/2013)


    This question is better suited for http://www.GeographyCentral.com.

    How does knowing the last day of February in 2016 have anything to do with SQL Server? I had to check a calendar in order to answer this question, books online was no good here.

    It would be sad if there was ever a book called, "Everything I Needed to Know I Learned in BOL"!

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

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

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