0

--Datetime format = '2013-10-21 12:12:12.000' --Obviously poor syntax but you can see what Im trying to do

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'
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
user2800758
  • 5
  • 1
  • 3

1 Answers1

0

you can use DATEFROMPARTS to create date type from shiftEndDate and then cast you condition strings to date/datetime (sql server should do this automatically, if no - use CAST/CONVERT)

Iłya Bursov
  • 23,342
  • 4
  • 33
  • 57