Solved

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

Posted on 2012-03-13
6
452 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
  • 3
  • 3
6 Comments
 
LVL 28

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 28

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 28

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now