SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Convert MicroSeconds to seconds
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ashishashish
Constraint Violating Yak Guru

India
408 Posts

Posted - 02/03/2010 :  01:29:37  Show Profile  Send ashishashish a Yahoo! Message  Reply with Quote
Hi All
I 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_time
these columns in seconds from sys.dm_exec_query_stats.
and also want to produce a column like avarage.
Somebody help me out in this

iF theRe iS a wAy iN tHen theRe iS a wAy oUt..

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 02/03/2010 :  03:46:40  Show Profile  Reply with Quote
just multiply by POWER(10,6) to convert to seconds
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

India
408 Posts

Posted - 02/03/2010 :  03:55:55  Show Profile  Send ashishashish a Yahoo! Message  Reply with Quote
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..
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17642 Posts

Posted - 02/03/2010 :  04:06:53  Show Profile  Reply with Quote
yes. Divide it by 1000000


KH
Time is always against us

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 02/03/2010 :  04:08:29  Show Profile  Reply with Quote
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
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

India
408 Posts

Posted - 02/03/2010 :  04:41:55  Show Profile  Send ashishashish a Yahoo! Message  Reply with Quote
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 explained

http://www.unitconversion.org/time/seconds-to-microseconds-conversion.html
http://www.unitconversion.org/time/microseconds-to-seconds-conversion.html


iF theRe iS a wAy iN tHen theRe iS a wAy oUt..
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000