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 |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-08-06 : 05:24:36
|
| Hi friends,I want to build a query with dynamic where clause, some thing like thisSelect * from mytableWhere case when @start_date_in is not null then start_time>=@start_date_in else 1=1 endCan u help to get this?Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-06 : 05:28:12
|
Select * from mytableWhere (@start_date_in is null or start_time >= @start_date_in) N 56°04'39.26"E 12°55'05.63" |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-08-06 : 05:34:03
|
quote: Originally posted by Peso Select * from mytableWhere (@start_date_in is null or start_time >= @start_date_in) N 56°04'39.26"E 12°55'05.63"
Thanks Peter it helps me alot.Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
|
|
|