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
 General SQL Server Forums
 New to SQL Server Programming
 select based on date

Author  Topic 

akck85
Starting Member

1 Post

Posted - 2012-01-24 : 01:34:11

Hi Guys,
I have a table named "employeeattendence".The columns are empid,status,empdate.It contain more than 25000 rows.
My requirement is that I have to keep last ten days(based on date) record in that table per employee, and all the other datas i have to select from the table and insert to another table named employeeattendencebackup.I am just wondering how I can select the older data per employee.
Any suggestions?
Thanks,
AK

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-24 : 03:23:42
My opinion:
You only have to select rows "where empdate < getdate()-10" regardless of employee.


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

- Advertisement -