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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 TWO DIFFERENT TIME DIVISION
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rohit Modesara
Starting Member

India
1 Posts

Posted - 01/20/2013 :  07:22:15  Show Profile  Reply with Quote
Hi all plz help me on below mentioned scenario :

Hour1 Hour2 PERCENTAGE
3:25:00 6:58:45 49%

Where PERCENTAGE = HOUR1 / HOUR2

Can any plz let me know how to get above result in SQL Server 2000.

Thanks a lot in advance........

Rohit Modesara

James K
Flowing Fount of Yak Knowledge

3323 Posts

Posted - 01/20/2013 :  11:49:38  Show Profile  Reply with Quote
DATEDIFF(mi,0, CAST('3:25:00' AS DATETIME))*100.0/DATEDIFF(mi,0,CAST('6:58:45' AS DATETIME))
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 01/21/2013 :  03:30:40  Show Profile  Reply with Quote
see logic here

http://visakhm.blogspot.in/2012/07/generate-datetime-values-from-integers.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

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