Solved

dividing issue in an expression

Posted on 2015-02-04
6
98 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Reporting 8 86
when creating a subscription get error 1 46
Data source in SSRS 2 51
SSRS 2013 - Creating a summarized report 19 35
Introduction: This article is aimed at report developers who are used to developing reports using relational databases and have gotten a first-time assignment to develop reports on OLAP cubes. It demonstrates how to build a report using SQL Ser…
Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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