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 2000 Forums
 SQL Server Development (2000)
 Is this possible

Author  Topic 

joshp
Starting Member

8 Posts

Posted - 2004-06-23 : 22:27:18
I am trying to retrieve the last seven days of entries from my SQL 2000 database. Does anyone have a simple sql query to do this?

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-23 : 22:28:27
Not without a date of entrty column or backups that you can compare against.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

joshp
Starting Member

8 Posts

Posted - 2004-06-23 : 22:30:56
Also, I am supplying the current date as the start date.

7 days of records from nowdate()
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-23 : 22:33:02
If you have a date column then

select * from tbl where dte between @dte and dateadd(dd,7,@dte)


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -