Running SQL Server 2008 R2.
I have an elapsed time column called [Elapsed_Time] with a data type of [varchar](50). This is due to the values in this column being stored in 'hh:nn' format. I have a requirement to calculate the total elapsed time for a set of rows.
CREATE TABLE [dbo].[Test]
[Elapsed_Time] [varchar](50) NULL
INSERT INTO [dbo].[Test]
I have started by converting the 'hh:nn' values to minutes in my query. My thought was I could SUM the minutes then do the conversion back to 'hh:nn' format but I'm stumbling on the last part. Based on the above sample there is a total of 2160 minutes. I would like to express the output as 36:00. I should also note that the output could exceed 100 hours (100:00) so I'm not sure that fixed-length string conversion is the way to go.
Thanks in advance for any assistance!