waqas shah

waqas shah

  • 1.7k
  • 78
  • 8.1k

How to convert negative time span to positive in SQL server

Jul 13 2015 3:10 AM

I have a situation in which some time duration is in negative format and stored as string in SQL database as

-06:34:41

and some of will be in positive format as

02:00:00 and

01:00:00

Now I need to add/sum these time duration in select query using SQL Server 2008 such that result will be

-03:34:41

and then after calculation i need it back into string format .Thanks in advance.


Answers (2)