SQLTeam.com | Weblogs | Forums

Update HH:MM:SS to Seconds


#1

Hi Guys,

I have a column in a table with HH:MM:SS( 1:20:00, 00:30:00...etc). I want to update this column with seconds.
can you help me how to update this column.?
Thanks.


#2

You can use the DATEADD FUNCTION

UPDATE myTable
SET myTime =DATEADD(second,10,myTime);


#3

I have a column in a table with HH:MM:SS( 1:20:00, 00:30:00...etc)

Hmm, that's actually rather difficult to do in SQL Server.

What is the actual data of the column:
varchar, smalldatetime, datetime, other?