Click here to Skip to main content
15,899,679 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to Calculate Total Time Difference Pin
Swinkaran4-Aug-14 16:28
professionalSwinkaran4-Aug-14 16:28 
SQL
<pre lang="SQL">/****** Script for Select the Time difference in HH : MM ******/
SELECT [Id],
CONCAT (DATEDIFF(HOUR ,StartDate, EndDate),
            N' : ',
            (DATEDIFF(MINUTE,StartDate, EndDate) % 60)) as TimeTaken
  FROM [dbo].[YourTable]

Above example, I am first finding the Hour, then finding the minutes. Finally, do a Concatenation to get the results in the format of HH:MM. Hopes this helps.
QuestionSQL SERVER DBA--- HELP ME WITH THIS.... Pin
Member 1097517927-Jul-14 20:57
Member 1097517927-Jul-14 20:57 
AnswerRe: SQL SERVER DBA--- HELP ME WITH THIS.... Pin
Tim Carmichael28-Jul-14 2:58
Tim Carmichael28-Jul-14 2:58 
AnswerRe: SQL SERVER DBA--- HELP ME WITH THIS.... Pin
Mycroft Holmes29-Jul-14 14:33
professionalMycroft Holmes29-Jul-14 14:33 
QuestionProblem with SSIS 2012 Pin
amioni24-Jul-14 0:41
amioni24-Jul-14 0:41 
SuggestionRe: Problem with SSIS 2012 Pin
Richard Deeming24-Jul-14 1:57
mveRichard Deeming24-Jul-14 1:57 
GeneralRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 2:04
amioni24-Jul-14 2:04 
QuestionRe: Problem with SSIS 2012 Pin
Richard Deeming24-Jul-14 2:13
mveRichard Deeming24-Jul-14 2:13 
AnswerRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 3:00
amioni24-Jul-14 3:00 
GeneralRe: Problem with SSIS 2012 Pin
Richard Deeming24-Jul-14 3:12
mveRichard Deeming24-Jul-14 3:12 
GeneralRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 3:25
amioni24-Jul-14 3:25 
QuestionRe: Problem with SSIS 2012 Pin
GuyThiebaut24-Jul-14 2:44
professionalGuyThiebaut24-Jul-14 2:44 
AnswerRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 2:51
amioni24-Jul-14 2:51 
AnswerRe: Problem with SSIS 2012 Pin
GuyThiebaut24-Jul-14 3:26
professionalGuyThiebaut24-Jul-14 3:26 
GeneralRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 4:09
amioni24-Jul-14 4:09 
GeneralRe: Problem with SSIS 2012 Pin
GuyThiebaut24-Jul-14 4:43
professionalGuyThiebaut24-Jul-14 4:43 
GeneralRe: Problem with SSIS 2012 Pin
jschell24-Jul-14 11:44
jschell24-Jul-14 11:44 
GeneralRe: Problem with SSIS 2012 Pin
amioni24-Jul-14 21:54
amioni24-Jul-14 21:54 
AnswerRe: Problem with SSIS 2012 Pin
amioni1-Sep-14 23:52
amioni1-Sep-14 23:52 
Questionsql server Pin
saharmirzaei23-Jul-14 8:12
saharmirzaei23-Jul-14 8:12 
QuestionRe: sql server Pin
Richard Deeming23-Jul-14 8:17
mveRichard Deeming23-Jul-14 8:17 
AnswerRe: sql server Pin
saharmirzaei23-Jul-14 22:30
saharmirzaei23-Jul-14 22:30 
GeneralRe: sql server Pin
PIEBALDconsult23-Jul-14 8:32
mvePIEBALDconsult23-Jul-14 8:32 
GeneralRe: sql server Pin
saharmirzaei23-Jul-14 22:26
saharmirzaei23-Jul-14 22:26 
AnswerRe: sql server Pin
Bernhard Hiller23-Jul-14 20:49
Bernhard Hiller23-Jul-14 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.