locked
INcorrect Syntax RRS feed

  • Question

  • User-797751191 posted

    Hi

       On below line i am getting above error

    set @sql = 'Insert into #tbl1(SalesPerson,BpName,'
    		Set @Sql = @sql + '[' + CAST(day(@DocDate) AS VARCHAR) +']) values(''' + @SalesPerson + ''',''' + @BpName + ''',' + isnull(CAST(@Amount AS VARCHAR),'')   
    		exec(@Sql)

    Incorrect syntax near '11665.00'.

    Thanks

    Monday, July 20, 2020 5:43 PM

Answers

All replies