2010-09-23 61 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);