Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

hour and minute between two datatime sql

Declare @InTime datetime='2017-11-27 10:00:00',
 @OutTime datetime='2017-11-27 11:15:00'

 SELECT CONVERT(varchar(5),DATEADD(minute,DATEDIFF(minute,@InTime,@OutTime),0), 114)
 -----------
 Result
 01:15
 
PREVIOUS NEXT
Tagged: #hour #minute #datatime #sql
ADD COMMENT
Topic
Name
1+8 =