Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 To update a part of data using substring

Author  Topic 

sudha12345
Starting Member

47 Posts

Posted - 2009-06-02 : 10:28:33
I has a column starttime wih dataype datetime and the data is like
11/12/2008 11:01:12 AM
11/12/2008 11:03:12 AM
11/12/2008 11:05:12 AM
11/12/2008 11:07:12 AM
11/12/2008 11:12:12 AM
11/13/2008 11:15:12 AM


with the date 11/12/2008 and different times there are nearly 100 rows
i has to update the date with 11/18/2008 with out changing the time

the result is

11/18/2008 11:01:12 AM
11/18/2008 11:03:12 AM
11/18/2008 11:05:12 AM
11/18/2008 11:07:12 AM
11/18/2008 11:12:12 AM

to acheive this how can we do this

Sudhakar

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-02 : 10:34:21
update table
set starttime=dateadd(day,6,starttime)
where ...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -