[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2012-03-13
6
Medium Priority
?
471 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

650 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