selvi subramanian

selvi subramanian

  • NA
  • 799
  • 571.9k

Add Query

May 6 2012 11:34 PM
Iam having a table with column name TotalHrs. Its data type is varchar
Time format is HH.MM.SS

I want to sum the column TotalHrs.

     TotalHrs                                      Date
    00:56:30 AM                               5/6/2012 
    02:08:40 AM                               5/6/2012 
    01:01:00 AM                               5/6/2012 

and get the o/p like this. 

O/P ==> 04:05:10.0000000

How can i get the above result

The query that I had wrote

SELECT SUM (HoursWorked) Total FROM logout where Date='5/6/2012'


I got the error message like this.....


Operand data type varchar is invalid for sum operator....

I need the query

Answers (4)