Showing posts with label hours minutes and seconds. Show all posts
Showing posts with label hours minutes and seconds. Show all posts

Wednesday, November 30, 2011

Date difference in Days,hours minutes and seconds.

SELECT Create_Date,Modify_Date,DATEDIFF(D,Create_Date,Modify_Date) AS Days,DATEDIFF(HH,Create_Date,Modify_Date)AS Hours,DATEDIFF(MI,Create_Date,Modify_Date)AS Minutes,DATEDIFF(SS,Create_Date,Modify_Date)AS SecondsFROM SYS.OBJECTs WHERE TYPE='U'AND CREATE_DATE != MODIFY_DATE