use DBA
IF OBJECT_ID('tempdb..#checkwaptreport') IS NOT NULL
    DROP TABLE #checkwaptreport
Declare @currentdate date
set @currentdate=getdate()
declare @currenthour int
--declare @columnc bigint=17
Declare @enddate datetime
set @enddate=getdate()
--print @enddate
SET @currenthour= DATEPART(hh,getdate())
declare @startdate datetime
SELECT @startdate=CONVERT(DATETIME, CONVERT(CHAR(8), @currentdate, 112) 
    + ' ' + LEFT(RIGHT('0' + @currenthour, 4),2) 
    + ':' + RIGHT(00, 2))
--print @startdate
 
No comments:
Post a Comment