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 |
|
adamsmithhrs
Starting Member
2 Posts |
Posted - 2007-11-06 : 09:45:52
|
| Hi,i need to create a sql statement to get the latest timestamp for a user and am strugglingmy table once it has been joined hasemployee id door permiter door time1 1 yes 12/12/2002 10:001 1 yes 13/12/2002 10:001 1 yes 14/12/2002 10:002 1 yes 12/12/2002 10:002 1 yes 13/12/2002 10:003 1 yes 12/12/2002 10:004 1 yes 12/12/2002 10:00So what i would like returned from this would be:employee id door permiter door time1 1 yes 14/12/2002 10:002 1 yes 13/12/2002 10:003 1 yes 12/12/2002 10:004 1 yes 12/12/2002 10:00could someone give me a pointer on this....very new to SQLthanks |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-11-06 : 11:44:41
|
| Hint: GROUP BY Employeeid, door, permitter and do a MAX(Doortime).Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
|
|
|