declare @p1code varchar(20)
set @p1code=:p1codeselect tjhjhbody.pluCode as 商品编码,tjhjhbody.pluname as 商品名称,tjhjhhead.supcode as 供应商编号,
tjhjhhead.htcode as 供应商合同号,tjhjhhead.supname as 供应商名称,tjhjhhead.billno as 验收单据号
from tjhjhbody,tjhjhhead
where tjhjhbody.plucode=@p1code and tjhjhbody.billno=tjhjhhead.billno我在模板里输入参数,然后点击查询,但是显示空白。
请大家指点我哪里写错误了?谢谢!
set @p1code=:p1codeselect tjhjhbody.pluCode as 商品编码,tjhjhbody.pluname as 商品名称,tjhjhhead.supcode as 供应商编号,
tjhjhhead.htcode as 供应商合同号,tjhjhhead.supname as 供应商名称,tjhjhhead.billno as 验收单据号
from tjhjhbody,tjhjhhead
where tjhjhbody.plucode=@p1code and tjhjhbody.billno=tjhjhhead.billno我在模板里输入参数,然后点击查询,但是显示空白。
请大家指点我哪里写错误了?谢谢!
==>这不是sql server 的写法.
我在模板里面输入123
tjhjhbody.plucode=@p1code 这个就变成 tjhjhbody.plucode=123
是不是这个意思?
set @p1code=p1codeselect tjhjhbody.pluCode as 商品编码,tjhjhbody.pluname as 商品名称,tjhjhhead.supcode as 供应商编号,
tjhjhhead.htcode as 供应商合同号,tjhjhhead.supname as 供应商名称,tjhjhhead.billno as 验收单据号
from tjhjhbody,tjhjhhead
where tjhjhbody.plucode=@p1code and tjhjhbody.billno=tjhjhhead.billno
set @p1code=p1code的语法不对呀.
p1code是什么呀,如果是变量,前面要@,如果不是变量,是什么呀,不合法
tjhjhhead.htcode as 供应商合同号,tjhjhhead.supname as 供应商名称,tjhjhhead.billno as 验收单据号
from tjhjhbody,tjhjhhead
where tjhjhbody.plucode=@p1code and tjhjhbody.billno=tjhjhhead.billno
这样就好了!
呵呵!