Posted on: 9/17/2012 3:34:49 AM | Views : 277

hello all,
           Actually for the last record  i write this query 
"WITH CTE AS ( SELECT ROW_NUMBER() OVER(PARTITION BY [username] ORDER BY [date] DESC) AS [RN],[date],[reportdate],[username],[TASKDESC],[CATEGORYA],[CATEGORYB],[CATEGORYC],[CATEGORYD],[CATEGORYE],[status],[pending],[reason],[department] FROM newstatus) SELECT * FROM CTE WHERE [RN]  =(select [RN] FROM CTE [DATE]= (select max(date) from newstatus) ) and  DEPARTMENT ='" + Label8.Text + "' ", conn);
 but problem is that it is show only single record but i want all last date records ,how i get multiple last date records please help me????
...

Go to the complete details ...