Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Time difference in hh:mm:ss

Select CAST((@EndDateTime-@StartDateTime) as time(0)) '[hh:mm:ss]'

--- OR ---

declare @StartDate datetime, @EndDate datetime
select @StartDate = '10/01/2012 08:40:18.000',@EndDate='10/04/2012 09:52:48.000'
select convert(varchar(5),DateDiff(s, @startDate, @EndDate)/3600)+':'+convert(varchar(5),DateDiff(s, @startDate, @EndDate)%3600/60)+':'+convert(varchar(5),(DateDiff(s, @startDate, @EndDate)%60)) as [hh:mm:ss]
Comment

PREVIOUS NEXT
Code Example
Sql :: sql cmd no truncate 
Sql :: supabase change timezozne 
Sql :: linq to sql converter online 
Sql :: how get data from database if id not found then search another column 
Sql :: create-table-with-index-organization 
Sql :: mysql select where field is a value 
Sql :: restarting of postgresql server when not connecting to default port 
Sql :: sql to migration codeigniter online 
Sql :: sql express database size limit 
Sql :: drop column from table if exist on live server mysql 
Sql :: see here: https://mode.com/sql-tutorial/sql-window-functions/ 
Sql :: how to set all the min and sec data to zero in sql server 
Sql :: composit key in sql 
Sql :: get item by composite primary key mysql 
Sql :: how to read the potentail error messages in ssis package 
Sql :: divide database into structured tables 
Sql :: report in database 
Sql :: sql server system messeges 
Sql :: calcul age 
Sql :: set mysql socket file docker windows 
Sql :: convert xml data to table format sql server 
Sql :: coderbyte sql solutions 
Sql :: Sql Cursor: Implicit 
Sql :: closure in sql 
Sql :: ORA-01400 
Sql :: pg_dump backup postgresql 
Sql :: sqlserver now 
Sql :: MQL4 mql4 run ea on all symbols by adding to just one chart 
Sql :: custom row number 
Sql :: export all stored procedures to .sql files 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =