从SQL Server中的DATETIME列中删除日期

时间:2018-06-09 14:35:21

标签: sql-server

我确信这是基本的,但我尝试了几种不同的方式来搜索StackOverflow以从c.CallStartWhenc.CallTime中删除日期。两者都是datetime列。

SQL Server 2017

Select Distinct 
    c.IncNo, c.CallStartWhen, c.CallTime,
    (c.CallTime - c.CallStartWhen) as difference1
From
    (Select    
         a.IncNo, a.CallStartWhen, b.CallTime
     From 
         tblClosedCalls a
     Right Join 
         tblUnitCallTimes b on b.IncNo = a.IncNo
     Where 
         b.CallDate Between '1/1/2010' And '1/2/2010' 
         And b.Status = '1') c

非常感谢任何帮助。

0 个答案:

没有答案