Getting error message

  • might be a problem with the int variables (@BusSrcId, @AdminId int, @FirmId int, @DaysOverdueRange) being used to generate the string...

    try to CAST the int values as varchar and see if that helps...

    if (@bussrcid is not NUll)

    begin

    set @strSql = @strSql + ' and ClientContBusSrcId= ' + char(39) + CAST(@BusSrcId as Varchar) + char(39) + ''

    end

    if (@adminid is not NULL)

    begin

    set @strSql = @strSql + ' and PlanPerIdAdmin='+ char(39) + CAST(@AdminId as Varchar)+ char(39) +''

    end

    if (@firmid is not NULL)

    begin

    set @strSql = @strSql + ' and tplans.planbillfirmid = '+ char(39) + CAST(@Firmid as Varchar) + char(39) + ''

    end

  • All that "begin"s must "end" 

    The "end" statement is missing for the first "begin".

    - Niranjan

Viewing 2 posts - 1 through 3 (of 3 total)

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