data conversion Error in update query

  • Frances,

    The answer has been mentioned in this thread so many times... USE THIS..

    update InpatientMedStat set  InpatientMedStat.PrincipalDiagnosisCode = ltrim(rtrim(rptpxa2.DCode)) from InpatientMedStat

     INNER JOIN   rptpxa2 ON InpatientMedStat.PatientAccountNumber = rptpxa2.PNO

    WHERE     (LEN(RTRIM(InpatientMedStat.PrincipalDiagnosisCode)) = 0) and (rptPXA2.DCode) = '1'

     


    Ronald San Juan | SQL DBA
    ID 710124 ~ Code "Northwind"

  • Thanx for the vote of trust .

  • Thanks. I was so wrapped for error and update field .

  • HTH.  Do you still need help understanding the concept of implicit conversions?

  • I think I am OK. Thx. I will pay more attention to execute plan in the future.

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply