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
 SQL Server Development (2000)
 date

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-03-17 : 08:39:19
if you have a field as int and it hold a value of 1753 hours, then how can this number of hours be converted to number of days and hours.
Thanks

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-03-17 : 08:42:19
[code]
Declare @hrs int
Set @hrs = 1753

Select
totalHrs = @hrs,
days = @hrs/24,
hrs = @hrs%24,
display = convert(varchar,@hrs/24) + 'days ' + convert(varchar,@hrs%24) + 'hrs'
[/code]

Corey

"If the only tool you have is a hammer, the whole world looks like a nail." - Mark Twain
Go to Top of Page
   

- Advertisement -