Search
 
SCRIPT & CODE EXAMPLE
 

SQL

cast find duration in sql

select 
  EventID, 
  TotalSeconds / 3600 as Hours, 
  (TotalSeconds % 3600) / 60 as Minutes, 
  TotalSeconds % 60 as Seconds
from
(
	select EventID, DateDiff(second, StartDate, EndDate) as TotalSeconds 
	from Events
) x


EventID     Hours       Minutes     Seconds     
----------- ----------- ----------- ----------- 
1           6           11          22
2           7           42          29
3           0           21          6
4           3           51          21
5           1           15          53
6           5           24          0
7           16          50          2

(7 row(s) affected)
Comment

PREVIOUS NEXT
Code Example
Sql :: oarcale list objects 
Sql :: Shell Comands 
Sql :: maximum number of tables in mysql 
Sql :: how to view full conversation with chat.db 
Sql :: sql server 2012 create or alter procedure 
Sql :: Perfect solution if some records deleted for LAST_ID 
Sql :: add sql file to seeder 
Sql :: match end of string regex sql 
Sql :: how to query all tables mysql at the same time 
Sql :: The fetch keyword oracle 
Sql :: sqlite ignore index 
Sql :: update values in select statement sql 
Sql :: ! Wildcard in SQL 
Sql :: oracle run_duration average 
Sql :: in query in sql 
Sql :: sqlite rename table 
Sql :: oracle find constraints referencing a table 
Sql :: Executing an update/delete query 
Sql :: sequelize with mysql nodejs 
Sql :: adonisjs ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: sql query by rahuldev 
Csharp :: unity next scene 
Csharp :: c# calcualte proccess 
Csharp :: unity check if space pressed 
Csharp :: vb.net wait 1 second 
Csharp :: c# new thread 
Csharp :: unity mouse click m 
Csharp :: how to download file from url using c# 
Csharp :: c# print to console 
Csharp :: unity movetowards 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =