title: Fix error - Conversion failed when converting nvarchar value to date type int in SQL
body: <p>I'm getting this error: </p>
  
  <blockquote>
    <p>Msg 245, Level 16, State 1, Line 10<br>
    Conversion failed when converting the nvarchar value 'PLANT001' to data type int</p>
  </blockquote>
  
  <p>I tried adding convert and cast as int to the first line that's getting the error as well as the last join but I still get the error. </p>
  
  <pre><code>SELECT
      hh.PlantID AS 'Plant ID',
      hh.ERP AS 'ERP',
      hh.ShipViaID AS 'Ship Via ID',
      cc.carrier AS 'Carrier',
      cc.service AS 'Service',
      cc.packagetype AS 'Pkg Type',
      hd.HandlingChargeTypeID AS 'Handling Charge ID',
      hd.HandlingCharge 'Handling Charge',
      hr.AdditionalPercentageAdded 'Heading Addl % Added',
      hd.ApplyToEachPackage AS 'Apply to Each Pkg',
      hr.MinimumHandlingCharge AS 'Min Handling Charge',
      hr.MaximumHandlingCharge AS 'Max Handling Charge'
  FROM 
      HandlingChargeHeader hh 
  JOIN 
      HandlingChargeDetails hd ON hd.HandlingChargeHeaderID = hh.ID
  JOIN 
      HandlingChargeRequirements hr ON hh.ID = hr.HandlingChargeHeaderID
  LEFT JOIN 
      xcarrier_codes cc ON cc.ID = hh.ShipViaID AND hh.PlantID = cc.plantid
  </code></pre>
  
  <p><code>cc.plantid</code> = <code>nvarchar</code>, <code>hh.plantid</code> = <code>int</code></p>