I have written a stored procedure that is suppose to return records from the previous day. I can't get it to work. Can someone please tell me what I am doing wrong?
Here is the Stored Procedure:
CREATE procedure dbo.GetNPT
as
DECLARE @ERRORCODE int
Declare @EndDate DateTime
Set @EndDate = GetDate() - 1
SELECT EmpID, SUM(DURATION) as Duration FROM DC_WrkJobTime2 WHERE (TranDate = @EndDate) GROUP BY EmpID ORDER BY EmpID
GO
Thanks in advance,
elmorro
Here is the Stored Procedure:
CREATE procedure dbo.GetNPT
as
DECLARE @ERRORCODE int
Declare @EndDate DateTime
Set @EndDate = GetDate() - 1
SELECT EmpID, SUM(DURATION) as Duration FROM DC_WrkJobTime2 WHERE (TranDate = @EndDate) GROUP BY EmpID ORDER BY EmpID
GO
Thanks in advance,
elmorro