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 - 2006-08-10 : 09:41:22
|
| Green writes "I'm trying to build a query where a user can pass any parameter (e.g. order id, name, or payment date). And sometimes would not enter the entire value for a field (e.g. Order ID = '53' instead of '533331'. So, I read about your examples using Coalesce but it does not seem to work if i use 'LIKE' instead of '='." |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-08-10 : 10:22:00
|
did you tryselect *from tablewhere Order_ID like coalesce(@Order_ID, Order_ID) + '%' KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-10 : 12:52:36
|
| Also search about Dynamic Search in Article's sectionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|