SQL join query
Posted on 2009-04-07
I have a database table with 4 columns, username, loginDate, loginTime, logoutTime. This table get populated nightly from a text file. I need to draw from this table the username, the date, the min(loginTime) and the max(logoutTime) for that username and date, and also return the total hours. I know this can be done using an inner join of some sort but beyond that I really don't know how to start on it. I could easily do it using multiple queries but since I am pulling it into an ASP.NET Datasource control it has to be condensed into a single query.
Any suggestions would be greatly appreciated.