Get Free SQL Tips



By:



We hope you enjoyed this tutorial.
Continue to learn about SQL Server.
Join MSSQLTips now!




Last Update: 2/5/2015






Comments For This Article




Monday, May 15, 2017 - 4:03:39 AM - Jean MBADI Back To Top (55773)

 Thank you very much. Great tutorial, specially on Inner Join. Overall, it is a big help and sums up a lot on books teaching SQL or T-SQL.

Big thank you

 


Friday, May 06, 2016 - 10:45:55 AM - Jeremy Kadlec Back To Top (41421)

Sam,

I responded directly via email.

Thank you,
Jeremy Kadlec
Community Co-Leader


Thursday, May 05, 2016 - 8:27:09 PM - Sam David Back To Top (41411)

 I enjoyeed you tutorial but the real challenge is How do I perform TimeDifference column calculation ( 7:08: 48 - 6:36:56 = 00:31:52) and so on using SQL? I have done it in Excel and I want to perform it using SQL. Can you please provide your expertise?

Please pay attention the way TimeDifference column values are populated in Excel. It is tricky. My current SQL code generates StartTime, EndTime as shown and for TimeDifference I have 0:00:00 but I want to perform same Excel capability in SQL.

 

 StartTime     EndTime TimeDifference

    6:36:56    6:36:56          00:31 :52

    7:08:48    7:26:18          00:00 :23

    7:26:41    8:08:26          00:00 :09

    08:35.0    16:54.0          00:09 :42

    26:36.0    59:34.0          00:00 :09

    59:43.0    19:13.0         #VALUE!

 

Don't go to StackFlow since they don't have an answer.

Thank You. 

 



download


get free sql tips
agree to terms


Learn more about SQL Server tools