此过程有一些错误帮助来解决此问题
问题描述:
CREATE PROCEDURE csp_GetDriverViolations
@nmcAccountId BIGINT
,@StartDate DATETIME
,@EndDate DATETIME
,@GroupId INT
AS
BEGIN
SELECT * FROM dbo.DriverViolationEvent dve
INNER JOIN Depot dp INNER JOIN Driver dr INNER JOIN Event e
ON (NMCAccount & DepotId, DriverId, CardId)
WHERE dve.EventType=VIOLATION
AND dve.Clock in (DRIVING, ONDUTY, CUMULATIVE)
AND dve.NCMAccount=@nmcAccountId
AND dve.EventTime=e.TimeDate
AND dve.EventTime BETWEEN @StartDate AND @EndDate
END
答
这可能是问题吗?
could this be the problem?
WHERE dve.EventType='VIOLATION'
AND dve.Clock in ('DRIVING', 'ONDUTY', 'CUMULATIVE')
(您未将引号放在字符串常量上)
hth,
foxyland
(you didn''t put the quotation on string constant)
hth,
foxyland