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)
 Functions to break down minutes

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2006-12-07 : 08:40:32
guys,

Is there any function in sql server where I can pass minutes and it will give me the output interms of hh:mi:ss.ms

thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-07 : 08:47:56
[code]declare @minutes float

select @minutes = 934.755

select dateadd(millisecond, @minutes * 60000, 0),
substring(convert(varchar, dateadd(millisecond, @minutes * 60000, 0), 121), 12, 12)[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-07 : 08:50:23
[code]declare @minutes int

select @minutes = 934

select dateadd(minute, @minutes, 0),
convert(varchar, dateadd(minute, @minutes, 0), 108)[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -