SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Parameter Eqaul to or Not Equal to


Parameter Eqaul to or Not Equal to

Author
Message
TJT
TJT
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 254
Hi,

I am faced with a problem.

I am trying to create a parameter that gives the choice, for example: I want all cars that have tinted windows, and all cars without tinted windows.

So I was thinking that it would be nice if I could create a parameter with = and <> . Unfortunately I am running into problems.

Any help is appreciated
sharonsql2013
sharonsql2013
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1272 Visits: 1265
Are you writing a store procedure for it?
TJT
TJT
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 254
No I didn't.

So far I wrapped my query in an expression and used a paramater within the expression. Works, but is slow
Tee Time
Tee Time
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1051 Visits: 465
Are there any defining characteristics in the data that you can key in on and use in a case statement so you can assign a Y or N (or something meaningful to you) value to each record, indicating if it is tinted or not?
TJT
TJT
SSC-Addicted
SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)SSC-Addicted (446 reputation)

Group: General Forum Members
Points: 446 Visits: 254
Here is what I did:

Example:

SELECT Manufacturer, Model
FROM CARS
WHERE Manufacturer = @Manf AND Model = '2 door'

Here is what I wanted a prompt for Model = '2 door' or Model <> '2 door'

I created a prompted with two option

Label Value
2 Door AND Model = '2 door'
Not 2 Door AND Model <> '2 door'

So I took the query and placed it in an Expression - from the Dataset.

="SELECT Manufacturer, Model FROM CARS WHERE Manufacturer = @Manf " & Parameters!Model.Value & " "

You now have a prompt to handle EQUAL to and NOT EQUAL to
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search