title: Convert from ACCESS TRANSFORM COUNT/PIVOT to SQL SERVER 2005
body: <p>Need some help converting from access <strong>TRANSFORM COUNT/PIVOT</strong> to <strong>SQL SERVER</strong> and here's the sql from access :</p>
  
  <pre><code>TRANSFORM Count(tmpTbl.TC) AS CountOfTC
  SELECT tmpTbl.SID, tmpTbl.CSID, tmpTbl.M,WoOr.QCL
  FROM tmpTbl INNER JOIN WoOr ON tmpTbl.WO = WoOr.WO
  WHERE (((tmpTbl.IsSelected)=True))
  GROUP BY tmpTbl.SID, tmpTbl.CSID, tmpTbl.M,WoOr.QCL
  PIVOT tmpTbl.TN;
  </code></pre>
  
  <p><strong>OUTPUT:</strong></p>
  
  <pre><code>SID |   CSID | M |   QCL | EPA 1 | EPA 2 |
  -----------------------------------------|
  1   |   A    |GW |  IV   |  3    |       |
  2   |   B    |GW |  IV   |       |  4    |
  ------------------------------------------
  </code></pre>
  
  <p>WHere there are <strong>3</strong> <code>EPA 1</code> count found and <strong>4</strong> <code>EPA 2</code> count found IN <strong>tmpTbl Table</strong>.</p>
  
  <p><strong>Thank YOU in ADVANCE!</strong></p>