sql get number of days between two dates
DATEDIFF(DAY, '1/1/2011', '3/1/2011')
sql get number of days between two dates
DATEDIFF(DAY, '1/1/2011', '3/1/2011')
how to get the date diff on once field in sql server
SELECT t1.OrderNo,DATEDIFF(day,t1.LoadedStartDate,t2.LoadedStartDate)
FROM UnnamedTableFromQuestion t1
INNER JOIN
UnnamedTableFromQuestion t2
on
t1.OrderNo = t2.OrderNo
WHERE t1.OpNo = 1 and
t2.OpNo = 4
////////////////////////////////////////////////////////////////
select cur.unique_id_field, cur.seq_no, cur.date_created ,
datediff(second, prv.date_created, cur.date_created) as diff_in_seconds
from yourtable as cur
join yourtable as prv
on cur.seq_no = prv.seq_no + 1;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us