Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-12-03 : 08:00:41
|
| Hemali Desai writes "I have one table PScriteria which contains criteria fieldscontains value like1.amt between 10000 and 200002.AND (type=educational or type = research)3.4.now In my query,In where clause I want single logical ecpression made of all criteria available in PSCriteria table Like select count(*) from table where(amt between 10000 and 20000AND (type=educational or type = research)....)" |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2004-12-03 : 08:18:33
|
| Hi!Use dynamic SQL. Declare a varchar variable and fill it with your statement. Then use exec () or sp_executesql to run it. You can look up sp_executesql in BOL for more information./Andraax |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-12-03 : 11:04:10
|
| Can you be more detailed as you what you are trying to do, what the end result is? from your description, it sounds like you are just storing a single WHERE clause, broken out into a table. Why do you feel you need to do this?- Jeff |
 |
|
|
|
|
|