title: Sql query for specific data
body: <p>I have an Archive Table. The columns are PK, Users and Logdatetime. When Users log in the system i am writing to archive table the user and datetime. A user can login more than one in one day. </p>
  
  <p>The data in Logdatetime is like '2010-03-16 00:00:00.000'</p>
  
  <p>I need to query all users FIRST Login time in one day and get the user with the datetime like:
  user1 '2010-03-16 03:21:00.000'
  user2 '2010-03-16 04:11:00.000'</p>
  
  <p>It does not matter the users order.
  I tried too many way but couldnt find a way. The only solution i found is the query for all users one by one. But it will take time. Any idea how to do this with a one query or more efficent way?</p>
  
  <p>PS: I am using MS SQL Server 2005</p>