Hello There,
I have table called logs and I have few columns in that along with StartDate and EndDate. I am trying to write a query that should
1. calculate the time difference between start date and end date
2. I want to display the result whose time difference is greater than 1 hours.
I have startdate and enddate column in YYYY-MM-DD HH:MM:SS:MS format. I have written query to calculate time difference between startdate and end date but unable to write a condition to calculate if that time difference is above 1 hr
My query is below
select StartDate, EndDate,
CONCAT((DATEDIFF(Minute,StartDate,EndDate)/60),':',
(DATEDIFF(Minute,StartDate,EndDate)%60)) TimeTaken ,
from Logs with(nolock)
where
StartDate!=EndDate
I see the result as below. But I want to add one more condition like I want to display the records where time taken is greater than 1 hour
