CREATE procedure St_Proc_GetTimeEntryID @userID int, @timeEntryID int output as begin set nocount on; SET @timeEntryID=0 DECLARE @TEMP INT SET @TEMP=0 SELECT @TEMP=ProductionTimeEntryID FROM production WHERE ProductionTimeEntryID = (SELECT MAX(ProductionTimeEntryID) FROM production where UserID=412 and (CalendarDate <= (select GETDATE())) and IsTaskCompleted=1 ) BEGIN SET @timeEntryID=@TEMP END END
(SELECT MAX(ProductionTimeEntryID) FROM production where UserID=412 and (CalendarDate <= (select GETDATE())) and IsTaskCompleted=1 )
SELECT CONVERT(Date, GetDate())
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
alter procedure St_Proc_GetTimeEntryID @userID int, @timeEntryID int output as begin set nocount on; SET @timeEntryID=0 DECLARE @TEMP INT SET @TEMP=0 SELECT @TEMP=ProductionTimeEntryID FROM production WHERE ProductionTimeEntryID = (SELECT MAX(ProductionTimeEntryID) FROM production where UserID=412 and ( CONVERT(VARCHAR(8), CalendarDate, 1) ) = CONVERT(VARCHAR(8), GETDATE(), 1) and IsTaskCompleted=1 ) BEGIN SET @timeEntryID=@TEMP END END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)