Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform
SELECT student_id, Date,week_no,
MIN(CONVERT(datetime, start_time)) AS 'Start Time',
MAX(CONVERT(datetime, End_Time)) AS 'End Time',
ROUND(cast((datediff(mi, MIN(start_time), MAX(end_time)) / 60.0) as FLOAT),2) AS 'Total Hours',
(DATEDIFF(minute, MIN(start_time), MAX(end_time)) - SUM(DATEDIFF(minute, start_time, end_time))) / 60.0 AS 'Total Breaks'
from allstudents
sample-student.xls
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
(CASE WHEN [total breaks] < 0 THEN '-' + convert(varchar, convert(int,ABS([total breaks]-([total breaks]%1))))+
':'+ convert(varchar, convert(int,60*ABS([total breaks]%1)))
else
convert(varchar, convert(int,floor([total breaks])))+':'+
replicate('0',(2 - len(convert (varchar, convert(int,([total breaks] - floor([total breaks])) * 60.0)))))
+convert (varchar, convert(int,([total breaks] - floor([total breaks])) * 60.0))
end) as 'Total Breaks',
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.