--date difference its give diff to hh/mm/ssCREATE
SELECT @DATEDIFF = DATEDIFF(SS,@DATE,GETDATE())
IF((@DATEDIFF % @TEST) <>0)
END
BEGIN
END
END
SELECT DBO.DAYDIFF('2010-09-19 12:11:50.750')NO_OF_DAYSRETURN @NO_OF_DAYSSET @NO_OF_DAYS = @DATEDIFF/@TESTELSE SET @NO_OF_DAYS = (@DATEDIFF/@TEST)+1BEGINSET @TEST = 86400/* @test represents no of seconds per day */DECLARE @NO_OF_DAYS INTDECLARE @TEST INTDECLARE @DATEDIFF INT
AS
BEGIN
FUNCTION DAYDIFF(@DATE SMALLDATETIME)RETURNS INT
No comments:
Post a Comment