Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 In statement with like
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 04/29/2006 :  08:38:02  Show Profile  Reply with Quote
I created a search program use Variable (VarModel, get value from text box) and like as bellow:
... where Model like 'VarModel%'
It works fine.

Now, I need add 3 text boxes to assign to 3 variable, Var1, Var2 and Var3, how to make where clause?

I knew that clause like bellow will not work:
... where Model in (like 'Var1%', like 'Var2%',like 'Var3%')

Can someone show a way to get same result so that user can input '%' in three input boxes to search?

Flowing Fount of Yak Knowledge

1907 Posts

Posted - 04/29/2006 :  09:11:51  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
how about this ??

Where (Model Like 'var1%' OR Model like 'var2%' OR Model like 'var3%')??

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000