title: MS Access converting row information to column
body: <p>I've spent hours trying to figure this one out. This is for a manufacturing plant.</p>
  
  <p>A person on the plant floor logs their activities on different machines using a computer system which produces data like this:</p>
  
  <pre><code>Empnbr  Datestamp   Shift   Machnbr Time
  00090   6/30/2010   1   0354    11:10
  00090   6/30/2010   1   S       12:00
  00098   6/30/2010   1   0920    7:00
  00098   6/30/2010   1   0143    7:30
  00098   6/30/2010   1   S       15:00
  00101   6/30/2010   1   0920    7:00
  00101   6/30/2010   1   0247    7:30
  00101   6/30/2010   1   0147    7:40
  00101   6/30/2010   1   S       15:00
  00107   6/30/2010   1   0585    7:00
  00107   6/30/2010   1   0143    12:00
  00107   6/30/2010   1   S       15:00
  00109   6/30/2010   1   0920    7:00
  00109   6/30/2010   1   0154    7:30
  00109   6/30/2010   1   0154    9:00
  00109   6/30/2010   1   0154    9:43
  00109   6/30/2010   1   0254    10:49
  00109   6/30/2010   1   0154    12:30
  00109   6/30/2010   1   S       15:00
  00111   6/30/2010   1   0591    5:00
  00111   6/30/2010   1   S       17:00
  00114   6/30/2010   2   0585    15:00
  00114   6/30/2010   2   S       23:00
  </code></pre>
  
  <p>The report I'm trying to write needs the information in such a form</p>
  
  <pre><code>Empnbr      Datestamp      Shift      Time Start       Time End       Machine
  </code></pre>
  
  <p>This will allow me to calculate the amount of time spent on each machine per person per day. Basically, Access needs to see an employee number, datestamp, and shift and take the first time it sees. Then needs to take the next time it sees and attribute that time to the machine on the first entry. This continues to happen until Access comes across a machine "S" which means signout.</p>
  
  <p>Now time to take some Advil for this headache -- thanks for your help!</p>