Conversion failed when converting the varchar value 'Grand Total' to data type int. RRS feed

  • Question

  • User1979860870 posted


      On below line u get above error

    Coalesce(UniqueId,convert(varchar(20),'Grand Total'))


    Wednesday, November 4, 2020 4:57 AM

All replies

  • User475983607 posted

    If UniqueId is an integer then your code tries to place a VARCHAR() in an INT column.

    Coalesce(convert(varchar(20), UniqueId), convert(varchar(20),[Grand Total]))

    The 'Grand Total' looks suspicious too.  Unfortunately, you did not share all the relevant code so we can only guess.  

    Wednesday, November 4, 2020 12:02 PM