SELECT Warehouses.Name,
RIGHT(CONVERT(VARCHAR,AirwayBillTrucks.CheckOutTime,100),7) AS CheckOutTime,
RIGHT(CONVERT(VARCHAR,AirwayBillTrucks.ReturnTime,100),7) AS ReturnTime
这是我的一段代码,CHECKOUTTIME和RETURNTIME曾经是DATETIME DD-DD-YYYY HH-MM-SS,但我将它们转换成TIME HH-MM-SS tt,这对我来说很好。现在我需要在几秒钟内完成这两列之间的差异,
答案 0 :(得分:0)
SELECT DATEDIFF(ss,CheckOutTime,CheckInTime)