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
 General SQL Server Forums
 New to SQL Server Programming
 Timediff

Author  Topic 

asm
Posting Yak Master

140 Posts

Posted - 2006-08-23 : 08:46:41
Hi

I have store minutes in numeric field in a table (Totmin)

Now i want to convert it into hour & minutes

Ex: Totmin - 114
result : 1 hours 54 minutes

How can i get it through SELECT statement


Thanks

ASM

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-08-23 : 08:49:34
[code]
Select Convert(varchar(10),114/60) + ' Hour ' + Convert(varchar(10),114%60) + ' Minutes '
[/code]

Chirag
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-23 : 13:03:22
Why dont you use proper DateTime datatype?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2006-08-23 : 14:27:26
If the data is something like "total elapsed minutes", why should it be stored with datetime datatype?
Go to Top of Page
   

- Advertisement -