Create Table #TMP_Base0001
(
goodsid int not null,
venderid int not null,
deptid int not null,
ShopID char(4) Not null,
taxrate dec(12,4) default 0 Null,
...........................
Go
create table #TMP_basesgroup
(
shopid char(4) not null,
shopname char(32) not null,
venderid int not null,
vendername char(64) not null,
goodsid int not null,
goodsname char(64) not null,
..........................
Go
exec LD_JXCBookMachine4goods 1,%D1%,%D2%,%paytypesortid%,%venderid%,%shopid%
Go
insert into #TMP_Basesgroup
select a.ShopID,b.name,a.venderid,g.name,a.goodsid,f.name,a.deptid,c.name,a.taxrate
..................
from #TMP_Base0001 A,shop B,dept C,userdept e,goods f,vender g
where A.shopid=b.ID and a.deptid=C.id
and a.goodsid=f.goodsid
and a.venderid=g.venderid
and a.deptid=e.deptid and e.username=[username]
%taxrate% %goodsid% %goodsname%
group by a.ShopID,b.name,a.venderid,g.name,a.goodsid,f.name,a.deptid,c.name,a.taxrate;
语句到这结束
Go
exec LD_JXCBookMachine4goods 1,%D1%,%D2%,%paytypesortid%,%venderid%,%shopid%
如果我在这里语句中的%venderid%改为%vendername%
就会报错 提示 将verchar转换成INT出错
%venderid%为纯数字,%vendername%为汉字字符
并且我的查询条件中定义了
%vebdername%=g.name like '%[名称]%'
我是菜鸟,平时都是找信息部的人修改,今天人都不上班没办法只能自己瞎改,而这个事情并须今天晚上完成,我现在需要如何在现在的语句上修改,! 感谢楼上的回答!
本回答被提问者采纳