Adding 1 Month to Date Calculation Column

  • I'm trying to create a calculated column to add 1 month to a date from another column.

    CREATE TABLE [dbo].[test_table_date](

    [date1] [datetime] NOT NULL,

    [date2] AS ([date1]+(month ,1))

    ) ON [PRIMARY]

    Please note that I am a complete novice to TSQL. Hope someone can help.

    Cheers

    Cory

  • CREATE TABLE dbo.Test

    (

    Date1 date NOT NULL,

    Date2 AS DATEADD(MONTH, 1, Date1)

    );

  • Paul

    Worked well Thanks for the help. 😀

Viewing 3 posts - 1 through 2 (of 2 total)

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