Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Conversion error

Author  Topic 

mrm23
Posting Yak Master

198 Posts

Posted - 2008-12-24 : 00:24:48
Hi,
How to convert the time '09:30:45' to number?
please suggest me as i need to do some calculations.

The time is in varchar datatype.

Thanks...

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-24 : 00:34:29
And how would the number be calculated? Number of total minutes? Number of total seconds?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-12-24 : 09:59:22
quote:
Originally posted by mrm23

Hi,
How to convert the time '09:30:45' to number?
please suggest me as i need to do some calculations.

The time is in varchar datatype.

Thanks...



Why would you store time in a varchar as opposed to a datetime? IMO it would make life a whole lot easier. You could the use some of the various functions provided with SQL (dateadd, datediff, etc.) that would possibly ease your calculation processes.

Terry
Go to Top of Page
   

- Advertisement -