Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Sql :: show all public tables sql 
Sql :: oracle ora-00054 find 
Sql :: ms sql truncate table vs delete 
Sql :: how to create an empty table from an existing table 
Sql :: oracle user privileges 
Sql :: postgresql restore from dump 
Sql :: sql asynchronous stored procedure call 
Sql :: mysql remove user privileges 
Sql :: install mysql 8 linux 
Sql :: mysql how to subtract dates 
Sql :: sql ends with string 
Sql :: sQL query to get all table records count from a database 
Sql :: mysql create timestamp column 
Sql :: sql last updated 
Sql :: mysql remove only_full_group_by permanently 
Sql :: postgresql substring 
Sql :: epoch time converter in snowflake 
Sql :: how to drop a database in sql server when it is in use 
Sql :: how to check xampp mysql password 
Sql :: sql create index 
Sql :: trim leading zeros in sql 
Sql :: drop multiple databases mysql 
Sql :: concate update mysq 
Sql :: restore postgres database from dump 
Sql :: delete dublicate rows sql 
Sql :: select and condition in sql 
Sql :: limit sqlserver 
Sql :: pl/sql loop example 
Sql :: date to string mariadb 
Sql :: sql drop default 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =