日期:2014-05-17 浏览次数:20437 次
declare @StartDate datetime,
@EndDate dateTime
select @tsql = @tsql + ' and a.UP_Time between ' + @StartDate + ' and ' + @EndDate
DECLARE @tsql NVARCHAR(max)
SET @tsql=''
declare @StartDate DATETIME='2013-04-26 00:00:01',
@EndDate dateTime ='2013-04-26 15:00:01'
--PRINT CONVERT(VARCHAR(30),@StartDate,120)
--PRINT CONVERT(VARCHAR(30),@EndDate,120)
SELECT @tsql =@tsql+ ' and a.UP_Time between ' +''''+CONVERT(VARCHAR(30),@StartDate,120)+'''' +' and ' +''''+CONVERT(VARCHAR(30),@EndDate,120)+''''
print @tsql