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 |
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2010-02-03 : 01:29:37
|
Hi AllI want to convert microseconds in to seconds in SQL Server.Specifically i want to convert total_elapsed_time,last_elapsed_time,min_elapsed_time,max_elapsed_timethese columns in seconds from sys.dm_exec_query_stats.and also want to produce a column like avarage.Somebody help me out in thisiF theRe iS a wAy iN tHen theRe iS a wAy oUt.. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-03 : 03:46:40
|
just multiply by POWER(10,6) to convert to seconds |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2010-02-03 : 03:55:55
|
I think it is divide, not multiply.I am going wrong or what?iF theRe iS a wAy iN tHen theRe iS a wAy oUt.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-03 : 04:06:53
|
yes. Divide it by 1000000 KH[spoiler]Time is always against us[/spoiler] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-03 : 04:08:29
|
quote: Originally posted by ashishashish I think it is divide, not multiply.I am going wrong or what?iF theRe iS a wAy iN tHen theRe iS a wAy oUt..
micro seconds means second divided by 10^6 so to make it back to second you need to multiply by 10^6 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2010-02-03 : 04:41:55
|
Hi Vishak sir sorry to interupt you again.. but i think you take it wrong 1 Sec=1000000 Micro Second So you have to Divide it by 1000000 by change it to again seconds.Here it is explainedhttp://www.unitconversion.org/time/seconds-to-microseconds-conversion.htmlhttp://www.unitconversion.org/time/microseconds-to-seconds-conversion.htmliF theRe iS a wAy iN tHen theRe iS a wAy oUt.. |
|
|
|
|
|