Group by in datagrid
Posted on 2006-03-31
I have a query that returns to me the last 3 days and this data is written to a datagrid. This is working. The only problem is that I would like to group it by date so that the I can get all information for one date on one line.
Currently it is displayed at
IN Date Out Date
03/30/2006 8:00 AM 03/30/2006 12:00 PM
03/30/2006 1:00 PM 03/30/2006 5:00 PM
I would like it to display as, the fields in the database are datatime. Thank you
Date InTime OutTime InTime OutTime
03/30/2006 8:00 AM 12:00 PM 1:00 PM 5:00 PM
**********current sql query *************
objCmd.CommandText = "select eh.recordid, firstname + ' ' + lastname as name, timein, timeout from employeehours as eh inner join employeelist as el on eh.employeeid = el.employeeid where firstname = 'Justine' and lastname = 'Cleary' and timein > CONVERT(datetime, '" & strCurrentdate & "', 102) order by timein "