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.
Author |
Topic |
sanjnep
Posting Yak Master
191 Posts |
Posted - 2006-05-31 : 12:17:34
|
I have following data:Date-----------------------2006-05-31 11:48:36.5472006-05-30 11:48:42.6232006-05-29 11:48:48.1232006-05-28 11:48:53.6102006-05-27 11:48:59.1232006-05-26 11:49:05.4502006-05-25 11:49:11.2502006-05-24 11:49:17.0772006-04-01 11:50:09.0902006-03-31 11:50:14.0902006-03-30 11:50:20.140------------------------------I need to delete all the date which is greater than 5 days.I mean I need to delete following from the table. 2006-05-26 11:49:05.4502006-05-25 11:49:11.2502006-05-24 11:49:17.0772006-04-01 11:50:09.0902006-03-31 11:50:14.0902006-03-30 11:50:20.140How to write sql plz help me.Thanks Sanjeev OH |
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2006-05-31 : 12:54:38
|
seems no one can help me :( ok bye Sanjeev Shrestha12/17/1963 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-05-31 : 14:14:27
|
quote: Originally posted by sanjnep seems no one can help me :( ok bye Sanjeev Shrestha12/17/1963
Patience is a virtue.If you have a SQL question, try posting it on one of the SQL Server Forums. I would suggest the New to SQL Server forum.This forum is for questions about this web site, so that is most likely why you didn't get an answer.CODO ERGO SUM |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-31 : 20:57:13
|
Please post in appropriate forum.delete dfrom yourtable dwhere yourdatecol < dateadd(day, datediff(day, 0, getdate()) - 5, 0) KH |
|
|
|
|
|