SQL Server: How to add a month to the current date

If you want to add a month to the current date in SQL Server, use the DATEADD function.

In this example, we add 1 month to the current date by combining it with GETDATE():

DATEADD(mm,1,GETDATE())

In this second example, we add two months to a date from another column called other_column:

DATEADD(mm,2,other_column)

You can use DATEADD to add hours, days, weeks or years to a date. You can find more information about this function in the documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax