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.
| Author |
Topic |
|
manu
Starting Member
41 Posts |
Posted - 2005-10-17 : 09:18:22
|
| hello,i want to convert integer into time format.suppose i have 600 ( seconds) in a field then i want to display itas (00:10:00) as a result of sql query.Pls helpMunish Gupta |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-10-17 : 09:26:00
|
select convert(varchar(10), dateadd (s, 600, '19000101'), 108)but formating should be done at presentation layerGo with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-17 : 09:26:53
|
| If you use Front End Application use this type of calculation thereOtherwise use thisdeclare @sec intset @sec=600select convert(varchar(5),@sec/3600)+':'+convert(char(2),@sec%3600/60)+':'+convert(char(2),(@sec%60))MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-17 : 09:27:59
|
>>select convert(varchar(10), dateadd (s, 600, '19000101'), 108)Perfect MadhivananFailing to plan is Planning to fail |
 |
|
|
manu
Starting Member
41 Posts |
Posted - 2005-10-17 : 09:41:13
|
| Yes sir,it is working properly.thanks a lot for your help.Munish Gupta |
 |
|
|
|
|
|
|
|