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 |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-02-13 : 06:41:43
|
| Dear All,i've one table, and table will be updating continuously.i need the data at every week. select * from my_table where my_datetime_column>=( from one week).getdate()-1 week.please guide me in this regard |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-13 : 06:48:11
|
SELECT *FROM Table1WHERE MyDateTimeColumn >= GETDATE() - 7 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-13 : 07:26:00
|
| Also considerSELECT *FROM Table1WHERE MyDateTimeColumn >= DATEADD(day,DATEDIFF(day,0,GETDATE())-7,0)MadhivananFailing to plan is Planning to fail |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-02-13 : 23:29:41
|
| Thank you very muchVinodEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
|
|
|