Prev: order by case value
Next: convert string to datetime
From: jgurgul on 10 Mar 2010 03:02 Typo on abbreviation for year should be DATEADD (yy , 1, col) or DATEADD (year, 1, col) note: y is dayofyear Jon "jgurgul" wrote: > Hi Ramesh > > UPDATE tbl SET col = DATEADD (y , 1, col) --adding 1 year > WHERE YEAR(col) = 2009 AND OtherCriteria > > > DATEADD (Transact-SQL) > http://msdn.microsoft.com/en-us/library/ms186819.aspx > > Jon > > "DVR" wrote: > > > Hi All, > > ----------------------------SQL SERVER 2008 Database----- > > > > The AP clerks forgot to change the year from 2009 to 2010, so they did > > lots of data entry with invoice dates instead of 2010, they added 2009 > > and the date field looks like this "2009-01-16 00:00:00.000", is there > > a way to replace 2009 with 2010. > > > > Please help me and thanks in advance, > > Ramesh > > . > > |