Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-03
5
Medium Priority
?
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:udaya kumar laligondla
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:
udaya kumar laligondla earned 1000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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

610 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