1
Hello
Find folowing snippet as per your provided date :
- --For total year difference
- ELECT DATEDIFF(year, '2018/01/14', '2018/01/15') AS Year;
- --For total Months difference
- ELECT DATEDIFF(MONTH, '2018/01/14', '2018/01/15') AS Months;
- --For total Days difference
- ELECT DATEDIFF(DAY, '2018/01/14', '2018/01/15') AS Days;
- --For total Hour difference
- ELECT DATEDIFF(HOUR, '2018/01/14', '2018/01/15') AS Hour;
- --For total Minutes difference
- ELECT DATEDIFF(MINUTE, '2018/01/14', '2018/01/15') AS Minute;
- --For total Seconds difference
- ELECT DATEDIFF(SECOND, '2018/01/14', '2018/01/15') AS Second;
- --For total Seconds difference
- ELECT DATEDIFF(MILLISECOND, '2018/01/14', '2018/01/15') AS Milliseconds;
Thanks