How to convert number of minutes to hh:mm format in TSQL?

前端 未结 12 2009
情话喂你
情话喂你 2020-12-03 09:48

I have a select query that has DURATION column to calculate number of Minutes . I want to convert those minutes to hh:mm format.

12条回答
  •  难免孤独
    2020-12-03 10:20

    How to get the First and Last Record time different in sql server....

    ....

    Select EmployeeId,EmployeeName,AttendenceDate,MIN(Intime) as Intime ,MAX(OutTime) as OutTime,
    DATEDIFF(MINUTE, MIN(Intime), MAX(OutTime)) as TotalWorkingHours
    FROM ViewAttendenceReport WHERE AttendenceDate >='1/20/2020 12:00:00 AM' AND AttendenceDate <='1/20/2020 23:59:59 PM' 
    GROUP BY EmployeeId,EmployeeName,AttendenceDate;
    
    

提交回复
热议问题