下面这个自定义函数为什么运行没有结果?谢谢!!
CREATE function dbo.qcrktj1(@date1 datetime,@date2 datetime,@p1 varchar(50),@q1 varchar(50))
returns table
as
return(
select 物资类别,器材名称,型号规格,计划价,
sum(实收数量) as 收入总数,sum(实收数量*计划价) as 收入金额
from 器材验收入库单 where @p1= @q1 and 入库日期 between @date1 and @date2
group by 物资类别,器材名称,型号规格,计划价
)
是不是因为两个变量@p1= @q1 不能相等!?