0
- Datetime format = '2013-10-21 12:12:12.000'
--Obviously可憐的語法,但你可以看到我試着做SQL Server 2008中的日期時間轉換成秒/毫秒
select personnum, convert(decimal, shiftEndDate, 4)-convert(decimal, ShiftStartDate, 4) as ShiftInSeconds
from dbo.Time
where shiftStartDate between '2013-10-14 00:00:00.000' and '2013-10-20 23:59:59.000'