January 23, 2012 at 11:25 pm
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 data i have to select from the table and insert to another table named employeeattendencebackup.I am just wondering how I can select the latest data per employee.
Any suggestions?
Thanks,
AK
January 23, 2012 at 11:31 pm
Anish..
Welcome to SQLServerCentral.com aka SSC.com..please take a look at this[/url]article by Jeff Moden on how effectively you can ask a question. You have put your business requirement but not the set up for us to give you a coded answer.
The problem can be easily handled by various methods , like Ranking functions, using temp table logic etc etc. Please provide the requested information and we can give you a tested answer.
thanks..
January 24, 2012 at 10:23 am
While we wait for your sample data, you can look at the DATEDIFF or DATEADD functions.
Jared
CE - Microsoft
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply