SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Cascading Free Text Parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sprotson
Yak Posting Veteran

75 Posts

Posted - 11/09/2012 :  16:41:23  Show Profile  Reply with Quote
I am currently running a simple report that has 1 input parameter of @IN_DNGroup which is defined in a stored procedure.

In the report the parameter drop down is populated with distinct DNGroups from a Dataset.

I am looking to add another parameter in the form of a free text box, so if you entered a letter in this box, then the next parameter (DNGroup) would be filtered to only show groups starting with that letter. This would need to work for a phrase also, eg wesq would return all groups beggining with wesq.

I have experience of cascading parameters, but I have no idea how I can filter with this criteria.

Any Suggestions?

LarryC74
Yak Posting Veteran

94 Posts

Posted - 11/17/2012 :  18:30:30  Show Profile  Reply with Quote
Hey!
Try something like this:

Select Distinct DNGroups
From Table
Where Left(DNGroups,Len(@Parameter)) LIKE @Parameter + '%'

So basically it takes the length of the parameter string as the variable for the "LEFT" function then use the LIKE and "%" to get everything after that.


Larry





Everyday life brings me back to reality
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000