title: How to get first in and last out and convert to another format
body: <p>Thanks in advance for your help.</p>
  
  <p>Hi there, i have a table AttendDB as show below it has many confused data.</p>
  
  <pre><code>
  Name    Date    Time    Status
  4900651 14/12/2015  7:52    I
  4900651 14/12/2015  12:26   O
  4900651 14/12/2015  12:27   I
  4900651 14/12/2015  17:04   O
  4900651 15/12/2015  7:51    I
  4900651 15/12/2015  12:04   O
  4900651 15/12/2015  12:08   I
  4900651 15/12/2015  17:03   O
  4900651 16/12/2015  7:50    I
  4900651 16/12/2015  12:12   O
  4900651 16/12/2015  12:13   I
  4900651 16/12/2015  17:03   O
  4900651 17/12/2015  7:52    I
  4900651 17/12/2015  12:09   O
  4900651 17/12/2015  12:35   I
  4900651 17/12/2015  17:02   O
  4900651 18/12/2015  7:54    I
  4900651 18/12/2015  12:16   O
  4900651 18/12/2015  12:17   I
  4900651 18/12/2015  17:04   O
  4900651 21/12/2015  7:48    I
  4900651 22/12/2015  7:49    I
  4900651 22/12/2015  12:11   O
  4900651 22/12/2015  12:31   I
  4900651 23/12/2015  7:46    I
  4900651 23/12/2015  12:13   O
  4900651 23/12/2015  12:13   I
  4900651 23/12/2015  17:05   O
  4900651 24/12/2015  7:49    I
  4900651 24/12/2015  12:22   O
  4900651 24/12/2015  12:23   I
  4900651 24/12/2015  17:04   O
  4900651 25/12/2015  7:54    I
  4900651 25/12/2015  12:27   i
  4900651 25/12/2015  12:28   O
  4900651 25/12/2015  12:28   I
  4900651 25/12/2015  17:04   O
  4900651 26/12/2015  7:46    I
  4900652 9/12/2015   11:28   I
  4900652 11/12/2015  8:55    I
  4900652 12/12/2015  16:10   I
  4900652 12/12/2015  16:10   I
  4900652 12/12/2015  16:10   I
  4900652 12/12/2015  16:11   I
  4900652 12/12/2015  16:12   I
  4900652 12/12/2015  17:01   O 
  </code></pre>
  
  <p>in data have many data per name entry because my HR want to keep six time per work day of employee "in-out(lunch) in(after lunch)-out(work) in(ot)-out(ot) I want the output as first in and last out show below</p>
  
  <pre><code>
  Name    Date    Time    Status
  4900651 14/12/2015  7:52    I
  4900651 14/12/2015  17:04   O
  4900651 15/12/2015  7:51    I
  4900651 15/12/2015  17:03   O
  4900651 16/12/2015  7:50    I
  4900651 16/12/2015  17:03   O
  4900651 17/12/2015  7:52    I
  4900651 17/12/2015  17:02   O
  4900652 14/12/2015  7:58    I
  4900652 15/12/2015  17:04   O
  </code></pre>
  
  <p>and if i want to query file to format like below, it can be do it?
  Thank for many help</p>
  
  <pre><code>
  4900651,14122015,0752I
  4900651,14122015,1704O
  4900651,15122015,0751I
  4900651,15122015,1703O
  4900651,16122015,0750I
  4900651,16122015,1703O
  4900651,17122015,0752I
  4900651,17122015,1702O
  4900652,14122015,0758I
  4900652,15122015,1704O
  </code></pre>