title: Update from one table to another table using SQL Server 2008
body: <p>I want to update data from one table to another table with year condition.</p>
  
  <pre><code>UPDATE pgptrans
  SET dcamt1 = t2.ecamt1
  FROM pgptrans t1 
  INNER JOIN pgptrans060713 t2 ON t1.empcode = t2.empcode 
  WHERE       
      t1.empcode LIKE '130%' 
      AND t1.yrmn = '201308' 
      AND t2.yrmn = '201207'
  </code></pre>
  
  <p>Here update <code>dcamt</code> of <code>pgptrans</code> table (to yr 201307) from <code>ecamt</code> of <code>pgptans060713</code> (from year should be 201308) with <code>empcode</code> starts from 130 </p>
  
  <p>please help me</p>
  
  <p>thanx in advance</p>
  
  <p>shubha</p>