2010-09-23 58 views

回答

0

我不知道我确切地理解你想要的东西,但是这应该做的伎俩:

Declare @time varchar(10) 

set @time = '18:15' 

Select Cast(floor(cast(getdate() as float))as datetime) + @time 
0

使用时间功能:

DECLARE @userProvidedTime AS CHAR(5); 
SET @userProvidedTime = '18:15'; 

SELECT DATEADD(DAY, 
      DATEDIFF(DAY, '1990-01-01 00:00:00.000', CURRENT_TIMESTAMP), 
      '1990-01-01 00:00:00.000'), 
+ CAST(@userProvidedTime AS DATETIME);