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 |
|
khinebo
Starting Member
2 Posts |
Posted - 2001-07-24 : 05:54:05
|
| There's a function in MS Access/Jet SQL called 'First()' which I found very useful. It works something like this. A normal SQL query such as below will return me repeated employee names for those persons who clocked in two or more times during that day:SELECT T1.Name, T2.InTimeFROM Employee T1INNER JOIN Attendance T2ON T2.EmployeeID = T1.EmployeeIDIf I am interested in only the *first* clock-in time for any one employee, then I could re-write the query like this in Jet SQL:SELECT T1.Name, First(T2.InTime)FROM Employee T1INNER JOIN Attendance T2ON T2.EmployeeID = T1.EmployeeIDGROUP BY T1.NameIs there an equivalent method in SQL Server which will return me the same result as above?KB |
|
|
|
|
|