[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Server 2005 Reporting Services - uses an aggregate function on data of varying data types error

Posted on 2006-04-18
2
Medium Priority
?
4,253 Views
Last Modified: 2008-12-08
New to Reporting Services and .Net as of yesterday <grin> from many years as a Crystal report user.  

I have this formula in my detail as a column:

= IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)

Which gives me detail as follows:
Current
0
0
4.55
1.25
0

I am grouping by customer and I want to sum this field at the group level.



=Sum(
 IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)
 ,"Customer")

if I preview and my column detail results are

0
4.55
1.25
0

I am getting the following error:
[rsAggregateOfMixedDataTypes] The Value expression for the textbox ‘CustCurrentSum’ uses an aggregate function on data of varying data types.  Aggregate functions other than First, Last, Previous, Count, and CountDistinct can only aggregate data of a single data type.

if I preview and my column detail results are
1.25
4.55
3.00

My sum works perfectly

After doing some research it looks like because CURTRXAM is a currency field it does not translate the 0 as also being a currency? Instead it is an integer?

So this is really my detail result?

0 integer
1.25 currency
1.65 currency
0 integer

and it is puking trying to summarize what it thinks are different data types?

So how do I indicate that the zero in the following function should be considered a currency type too?

= IIf(Fields!AGNGBUKT.Value = 1,Fields!CURTRXAM.Value,0)

This specific 'manual crosstab' scenario is one I am going to run into extensively trying to translate Reports desinged in Crystal to RS 2005, I appreciate any assistance in understanding the syntax and what exactly isn't working.

Thanks again
Julie
0
Comment
Question by:djehmli
2 Comments
 

Author Comment

by:djehmli
ID: 16480826
I found the answer to my question, in case any other new user to Report Services and .Net runs into the same scenario.


= IIf(Fields!AGNGBUKT.Value = 1,Cint(Fields!CURTRXAM.Value),0)

I had to change the currency field to integer.
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16482646
Closed, 300 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

834 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