SQL Basics

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesSQL Basics

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old January 9th, 2018, 01:11 PM
karlw karlw is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2018
Posts: 0 karlw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 57 sec
Reputation Power: 0
Question Setting up Parameters in MS SQL Server 2012 Report Builder

First I apologize if this topic already exists, but after registering, this website would not allow me to search.

2nd, I'm very, very green to all things SQL so I'll try my best to explain as much detail as possible.

I first created the following query using MS SQL Server Management Studio 2012. I typically build and test first using this software.

declare @SearchValue as VarChar(60) = '%Central%'
select
ContractID
, Name1
, Name2
, Name3
from LeaseData.dbo.vContractsAll
where
(Name1 like @SearchValue or Name2 like @SearchValue or Name3 like @SearchValue)


The above query works as expected (except I have %Central% hard-coded and I will need this to be parameter input in Reporting Services). But it does find the declared value %Central% in any of the 3 'Name' fields.

I then copied this query into MS SQL Server 2012 Report Builder (version 11.0.3513.0). I use this reporting tool so that the report/query can be published and used by other internal employees.

So here's where I'm struggling. In Report Builder, I can't figure out how to setup the wildcard search as a parameter so that 1 input (such as the word "%Central%") will be searched for in all 3 'Name' fields and return matches if %Central% is found in any 1 of the 3 'Name' fields.

Do I keep the Declare line? If yes, does this line need to change? How do I change the '%Central%' to be a parameter within this line?

Reply With Quote
  #2  
Old January 9th, 2018, 01:49 PM
karlw karlw is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2018
Posts: 0 karlw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 57 sec
Reputation Power: 0
Here's what I have so far in Report Builder

I create the Parameter @SearchValue
I removed the first line (the Declare)
and I changed my Where line to the following

(Name1 like '%@SearchValue%' or Name2 like '%@SearchValue%' or Name3 like '%@SearchValue%')


Doesn't work. But I believe I'm close.

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSQL Basics > Setting up Parameters in MS SQL Server 2012 Report Builder


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap