??????SQL?洢?????и????????????????????????????????????????洢?????н?????where???ó??????仯?????where?????????????????????execute(SQL)
set @where= '(DATEDIFF(day??'''+CONVERT(varchar(100)?? @d_start?? 23)+'''??sdate)>=0 and DATEDIFF(day??'''+CONVERT(varchar(100)?? @d_end?? 23)+'''??sdate)<=0) and '
+'  shopid='''+@shopid+''' and  VenderID in '
+' (select vender from tableB where vendertype=''????'' and shopid='''+@shopid+''')'
@d_start   @d_end??
@shopid
?????????????????洢?????????????????????Щ??varchar????????????????????????????+?????? eg: where shopid='''+@shopid+''' ????д??????