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
 to find the division and result
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shrawon2011
Starting Member

Nepal
1 Posts

Posted - 02/23/2013 :  23:18:22  Show Profile  Reply with Quote
if student get 430 marks out of 600 marks then how to find percentage,
division and result

shrawon

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2062 Posts

Posted - 02/24/2013 :  02:42:37  Show Profile  Visit jackv's Homepage  Reply with Quote
This would give you the answer, but overall ,if this is part of an application, i'd complete at the presentation layer

declare @total decimal(10,2),@part decimal (10,2)
set @total = 600
set @part = 430

select (100 /@total) * @part

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 02/24/2013 :  23:25:56  Show Profile  Reply with Quote
marks*100.0/totalmarks should give you percentage

------------------------------------------------------------------------------------------------------
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.05 seconds. Powered By: Snitz Forums 2000