?
Solved

Need help with parameters that aren't matching up in SSRS

Posted on 2012-03-13
6
Medium Priority
?
467 Views
Last Modified: 2012-03-13
I'm having trouble filtering my report using parameters.  I'm trying to create a dropdown list for teams and I'm having trouble because the team identifier in one table is different than another.  For example in Clients table the team is 'TBD' (the initials of the team leader) but in the invoice/expense table its 'TmLdr - TBD'.  I've tried adding 'TmLdr - ' to the query when capturing data from the clients table and I've tried Substring it in the invoice/expense table query to capture only the information after 'TmLdr - ' but I still get no results when I run the program.  They appear correct when testing the query in the query builder, it looks like I get the results that I want and that match the other table I'm trying to access but still I'm geting no results when previewing the full report.
0
Comment
Question by:HSI_guelph
[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
  • 3
6 Comments
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 2000 total points
ID: 37715510
Why not use wildcard search to filter?

Something like where teamleader LIKE '%TBD'

This way whether you enter Tmldr-TBD or just TBD, you will get a hit.
0
 

Author Comment

by:HSI_guelph
ID: 37716391
I did try to use a wildcard but while it worked in the query designer it didn't work in reporting preview.  I might have done it wrong because I was also including a parameter,
 (Clients.CRPnum LIKE '%' + @TeamID + '%').  I'm getting results when I test it in query designer but not on the report.

The way my report is laid out is that my main report has dataset dsClientBudget where the TeamID is saved like this 'TmLdr - TD' and it takes a parameter @TeamID where the user chooses a Team to filter the budget report.  The available values for the dropdown list are populated from a dataset called dsTeams with
SELECT     DeptID, DeptName AS TeamID
FROM         Department
WHERE     (DeptID > 0)
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37716660
Hmm, weird that you are getting data from designer but not from report.

First, this filter below won't work as you described it earlier:

(Clients.CRPnum LIKE '%' + @TeamID + '%').  

According to you, you have values such as  'TBD' and 'Tmldr-TBD', no?

If yes, then to get either TmIdr-TDB and/or TBD, you are going to use:

(Clients.CRPnum LIKE '%' + @TeamID).  

Then

SELECT     DeptID, DeptName AS TeamID
FROM         Department
WHERE     (IsNull(DeptID,0) > 0)

That's how I would try it.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:HSI_guelph
ID: 37716840
Thank you for the help but its still not working.  At this point I have to believe it is the data within the database.  I've found another field that seems to have identical values when I use it to import the team from the Teams table.  I'll double check but I believe this is the ID integer from Department table (DeptID).  It is very confusing when multiple fields represent the same data but I will need to work with it as is because making changes would compromise data validity for whatever other programs might be accessing the database.
Perhaps I should create something outside of those tables, like a view, that contains and connects all the tables and data I would require when working with reports?  Ah but that is a topic of another question, lol.

TY for your help!!!
0
 

Author Closing Comment

by:HSI_guelph
ID: 37716850
Great advice but setup of my database and the data within prevented this solution from working.
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37716852
If you want me to test, you can attach sample data from your tables and I will install here and test for you.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

762 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