Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Act without doing; work without effort
 
Tao Te Ching
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

13
October

How Do I write a percentage formula in SQL

During a recent training session, a number of delegates asked how do they write a percentage formula, that does not result in 0.

When writing percentage formulas within SQL, it always returns a 0.

Solution:

The only way to resolve this issue, to convert both the denominator and numerator fields to Float data types, while creating the percentage formula:

(CAST(Numerator) As Float / CAST(Denominator ) As Float ) * 100

If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *