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