I have two columns in SQL table 'Start-Time' and "End-Time" in 12 hours time. I want to calculate the Hours field in new column based on difference between start tie and end time. Please guide me.
Regards,
Dinesh
Answer by Magnus Ahlkvist · Sep 12, 2018 at 09:18 AM
You could do it basically like this (untested, but I think it will work):
SELECT Start_Time, Finish_Time, DATEADD(minute, DATEDIFF(minute,start_time,finish_time), '00:00:00' ) as [Hours] FROM some_table;
How do you create a non clustered index? 6 Answers
What is the maximum amount of RAM I can use? 1 Answer
Where can I find a full list of the possible values of SQLCODE? 1 Answer
EXCEPTION_ACCESS_VIOLATION SQL 7.00 1 Answer
sql import error 2 Answers