Solved

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

Posted on 2012-03-13
6
456 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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.
In this article I will describe the Copy Database Wizard 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.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

810 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