title: Incorrect syntax near ' *= ' in SQL server 2012
body: <pre><code>SELECT  LM.LocationName ,
          PPD.RegistrationNo ,
          ISNULL(PPD.Title, '') + ' ' + ISNULL(PPD.FirstName, '') + ' '
          + ISNULL(PPD.LastName, '') AS CustomerName ,
          PPD.RegistrationDate ,
          PPD.Ref_By_Patient ,
          ISNULL(PPD1.Title, '') + ' ' + ISNULL(PPD1.FirstName, '') + ' '
          + ISNULL(PPD1.LastName, '') AS Ref_By_PatientName ,
          PPD.Mobile ,
          PPD.Res_Telephone ,
          PPD.Off_Telephone ,
          PPD.EMail ,
          KB.KwnBy ,
          RTM.RegType ,
          PPD.Street ,
          AM.area_name ,
          CM.city_name ,
          DM.DoctorName ,
          PPD.SpecialDiscount ,
          PPD.SpecialDisPercentage ,
          PPD.ServiceDisPercentage ,
          PPD.Type ,
          PPD.TypeChangedDate
  FROM    Patient_Personal_Details PPD ,
          LocationMaster LM ,
          KnownBy KB ,
          Area_Master AM ,
          RegTypeMaster RTM ,
          City_Master CM ,
          Doctor_Master DM ,
          Patient_Personal_Details PPD1
  WHERE   PPD.Loc_Id = LM.LocationCode
          AND PPD.Knownby*=CAST(KB.Knwid AS VARCHAR(25))
          AND PPD.Area*=AM.area_id
          AND PPD.City*=CM.city_id
          AND PPD.Doctorname*=DM.Doctor_Id
          AND PPD.RegTypeId*=RTM.RegTypeId
          AND PPD.Ref_By_Patient*=PPD1.RegistrationNo
          AND PPD.RegistrationDate &gt;= '01-Oct-2013'
          AND PPD.RegistrationDate &lt;= '10-Dec-2013'
  ORDER BY LM.LocationName ,
          PPD.RegistrationNo
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Incorrect syntax near '*='.</p>
  </blockquote>
  
  <p>Please advise</p>