(SQL) Tip of the Day: Microsoft Azure SQL Support Blog


Today’s (SQL) Tip…

Simple one today, we have started up a blog for supporting Azure SQL Database. You will see tips, tricks, and current issues as they come up posted to the site. It is currently pretty sparse but we will be adding new information as it comes up!

http://blogs.msdn.com/b/azuresqldbsupport/


Comments (1)

  1. Kris says:

    I have a question below could you please answer?
    User wants to go back 6 months from current month and go forward 6 months.

    T-SQL
    select CAST(DATEADD(MONTH, -6, GETDATE()) AS DATE);
    — Result 2015-05-13

    select CAST(DATEADD(MONTH, 6, GETDATE()) AS DATE);
    — Result 2016-05-13

    SSRS
    =CDATE(Format(DateAdd("d",-1,(DateAdd("m", -6, DateSerial(Year(Now()), Month(Now()), 1)))),"MM/dd/yyyy"))

    –Result 4/30/2015

    =CDATE(Format(DateAdd("d",-1,(DateAdd("m", 6, DateSerial(Year(Now()), Month(Now()), 1)))),"MM/dd/yyyy"))

    — Result 4/30/2016

    When I use the above code gives different results, why?

Skip to main content