MS SQL SERVER get countdown
Posted on 2011-02-25
So whenever the user presses a button, it runs a sproc ... i need to return a value of current_date- top of the hour...so for example...if the user presses the submit at 1:31
Then it would return "29"..because its 29 minutes till 2:00
Next_delevery_date_go_hour = (top of the hour) - (currdate) .....
DECLARE @CURR_DATE smalldatetime
SET @CURR_DATE = ISNULL(@CURR_DATE, getDATE())
-- i may not have this right...
--round it up...
DECLARE @round_up_DATE smalldatetime
SET @round_up_DATE = ISNULL@round_up_DATE, getDATE())
declare @countdown nvarchar(10)
set @countdown = @round_up_DATE - @CURR_DATE
--- i know this is off ....