Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011
    Posts
    2

    Unanswered: How to update year?

    Hi,

    Can someone help me to update the year in table. The table name is ProductConsumption and column name is ConsumptionDate in which i have multiple rows if different date but only with year 2009, for ex:15/01/2009 and so on. I need help how to update only a year here from 2009 to 2010.

    Can someone please help me, its SQL Server 2005

    Thanks,
    Raveen

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    UPDATE ProductConsumption 
       SET ConsumptionDate = DATEADD(YEAR,1,ConsumptionDate)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2011
    Posts
    2
    Hi Thanks a Lot, it worked.

    Raveen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •