Solved

dividing issue in an expression

Posted on 2015-02-04
6
95 Views
Last Modified: 2015-02-05
=Sum(Fields!TotalDays.Value, "dsTotalDays") \ Sum(Fields!DocumentCount.Value, "dsDocumentCont")

Where total days = 14

document count = 5

is returning and even 2 how do i get decimals?
0
Comment
Question by:vbnetcoder
  • 3
  • 2
6 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40589736
What you are experiencing is referred to as 'integer math', where SQL Server will process two integer numbers in a divide option and return a value of an integer, e.g. 9 / 2 = 4 instead of 4.5
integer-math.jpgTo get a return value with decimal places, then you'll have to convert one of the values in the division to contain decimal values.
0
 

Author Comment

by:vbnetcoder
ID: 40589758
how would i do this in SSRS using the expression i posted?
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40589770
I don't have a picture handy, but it'll likely be as simple as using a function that converts to a data type that supports decimal values, such as CDbl(), CSng(), etc.

=Sum(Fields!TotalDays.Value, "dsTotalDays") \ CSng(Sum(Fields!DocumentCount.Value, "dsDocumentCont"))
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:vbnetcoder
ID: 40589800
That didn't work
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40590551
Change the operator (\ for /):
=Sum(Fields!TotalDays.Value, "dsTotalDays") / Sum(Fields!DocumentCount.Value, "dsDocumentCont")

Open in new window

0
 

Author Closing Comment

by:vbnetcoder
ID: 40590764
ty
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now