I am fetching the attendance details of employees in a datatable . It looks like this
Day SwipeTime
12/31/2012 11AM
12/31/2012 1PM
12/31/2012 7PM
12/31/2012 8PM
1/1/2012 2PM
1/1/2012 7PM
1/1/2012 8PM
1/2/2012 10AM
1/2/2012 8PM
I need to display the date and totalhours for an employee where totalhours = lastswipe - firstwipe
my result would look like
Day TotalHours
12/31/2012 9
1/1/2012 6
1/2/2012 12
So i need to find min and max swipes grouped by date. Please help me write the query