Solved

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

Posted on 2012-03-13
6
462 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

707 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