我有一个为报告提取数据的存储过程。我的参数有问题。我有几个临时表和一些有效的连接,所以我在下面省略了它们。问题是这一行:
WHERE
SeminarDivision = @SeminarDivision AND SeminarType = @SeminarType
当我将这个 where 子句放入使用我的研讨会参数时,存储的过程不会返回任何内容但我需要根据这两个参数生成报告。那么参数去哪了?任何人都可以帮忙吗?
@StartDate DateTime,
@EndDate DateTime,
@SeminarDivision VARCHAR(50),
@SeminarType VARCHAR(50)
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
... OMITTED
SELECT
WL.PID,
CONVERT(varchar(20), upper(substring(FirstName,1,1))+
LOWER(substring(FirstName,2,19))) AS FirstName,
CONVERT(varchar(20), upper(substring(LastName,1,1))+
LOWER(substring(LastName,2,19))) AS LastName,
S.SeminarDivision,
S.SeminarType,
S.StartDate,
S.SeminarLocation
FROM
@tblWaitList WL
INNER JOIN @tblSeminar S ON WL.SeminarGuid=S.SeminarGuid
WHERE
SeminarDivision = @SeminarDivision AND SeminarType = @SeminarType
ORDER BY
LastName,FirstName,StartDate