I need help selecting a contractor 1st log record and last log record for each day.
Contractor_Table
Co_# SSN LOG_DATETIME
100 012349991 4/27/2003 9:29:39 AM
100 012349991 4/29/2003 8:34:57 AM
100 012349991 4/30/2003 8:34:57 AM
100 012349991 4/30/2003 9:29:39 AM
100 012349991 4/30/2003 12:43:16 PM
100 012349991 4/30/2003 4:14:02 PM
110 034549991 4/30/2003 12:43:16 PM
110 034549991 4/30/2003 4:14:02 PM
The result should be:
Co_# SSN LOG_DATETIME_IN LOG_DATETIME_OUT 100 012349991 4/27/2003 9:29:39 AM
100 012349991 4/29/2003 8:34:57 AM
100 012349991 4/30/2003 8:34:57 AM 4/30/2003 4:14:02 PM
110 034549991 4/30/2003 12:43:16 PM 4/30/2003 4:14:02 PM
How can I write a query to show these result?
Contractor_Table
Co_# SSN LOG_DATETIME
100 012349991 4/27/2003 9:29:39 AM
100 012349991 4/29/2003 8:34:57 AM
100 012349991 4/30/2003 8:34:57 AM
100 012349991 4/30/2003 9:29:39 AM
100 012349991 4/30/2003 12:43:16 PM
100 012349991 4/30/2003 4:14:02 PM
110 034549991 4/30/2003 12:43:16 PM
110 034549991 4/30/2003 4:14:02 PM
The result should be:
Co_# SSN LOG_DATETIME_IN LOG_DATETIME_OUT 100 012349991 4/27/2003 9:29:39 AM
100 012349991 4/29/2003 8:34:57 AM
100 012349991 4/30/2003 8:34:57 AM 4/30/2003 4:14:02 PM
110 034549991 4/30/2003 12:43:16 PM 4/30/2003 4:14:02 PM
How can I write a query to show these result?