Solved

How can I get the value of my textbox in reporting services to include a sum expression?

Posted on 2009-04-03
5
280 Views
Last Modified: 2012-05-06
Hi,
I have the following in one of my text boxes on my value:

= "Total Number of Incidents in Service Alliance queue: "&"          "&Sum(Fields!TotalIncidents.Value, "IncidentsInSAQueue")

IncidentsInSAQueue is the name of my dataset:

select count(sequence) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'

When I try to run I get this error:
C:\Reports\Astea\Astea\Service_Alliance_Incident_Report.rdl A value expression used for the report parameter '=count(sequence)' includes an aggregate function.  Aggregate functions cannot be used in report parameter expressions.

Can someone please show me how this should be entered into the textbox?

Thanks,
Rhonda
0
Comment
Question by:Rhonda Carroll
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:udayakumarlm
ID: 24058843
no aggregate functions are allowed in the report parameters.
if you have to provide the aggregate value then make it part of the query to generate the aggregate value as a field, and use the field as parameter
create select as
select A,B,C,(select Count(A) as CountA) from tableName
and use CountA as parameter
0
 

Author Comment

by:Rhonda Carroll
ID: 24059134
Hi udayakumarlm:

Can you modify my query to do this?

This is my orginal:
select count(sequence) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'

I tried:
select sequence, (select count(sequence) as seq) from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'    

and used this in my text box:
= "Total Number of Incidents in Service Alliance queue: "&"          "&(Fields!seq.Value, "IncidentsInSAQueue")

but it gives a group by error
0
 
LVL 12

Accepted Solution

by:
udayakumarlm earned 250 total points
ID: 24059184
use
select count(sequence) as seq from _SMDBA_._TELMASTE_
where  [date open] > '01-oct-08'
and _SMDBA_._TELMASTE_.subject = 1381
and _group_ in (1011, 1004)
and status = 'O'
0
 

Author Comment

by:Rhonda Carroll
ID: 24059244
Did that too, look at the pic to see what is happening.
report-error.doc
0
 

Author Comment

by:Rhonda Carroll
ID: 24059269
never mind got it. Thanks!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

776 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