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 |
|
sanjay_jadam
Yak Posting Veteran
53 Posts |
Posted - 2005-12-20 : 00:54:34
|
| I have a dropdown list in my user interface called Prequalifiedthis dropdown shows value (blank,Yes,No)when user don't select any value then dropdown value is blankI have a table in which i have to field PrequalifiedBy and PrequalifiedDate but i don't have any field which having yes/No or bit datatype what i want to do is1 when user select blank then i want to show all record from my table2 when user select No then i want to select those row whose PrequalifiedDate and PrequalifiedBy is empty or NULL3 when user select Yes then i want to select those row whose PrequalifiedDate and PrequalifiedBy is not empty or NULL.(means there is some value)please solve these problem without using EXECand xp_executesqlPlease help me |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2005-12-20 : 01:13:07
|
Something like this . . . where ( @userselect = 'blank'or (@userselect = 'No' and PrequalifiedDate is NULL and PrequalifiedBy is NULL)or (@userselect = 'Yes' and PrequalifiedDate is NOT NULL and PrequalifiedBy is NOT NULL)) -----------------[KH]Learn something new everyday |
 |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2005-12-20 : 01:20:11
|
| khtan, i think this wont take care of blank recordstry this..where ( @userselect = 'blank'or (@userselect = 'No' and isnull(PrequalifiedDate,'')='' and isnull(PrequalifiedBy,'')='')or (@userselect = 'Yes' and isnull(PrequalifiedDate,'')<>'' and isnull(PrequalifiedBy,'') <>'')) |
 |
|
|
sanjay_jadam
Yak Posting Veteran
53 Posts |
Posted - 2005-12-20 : 01:22:40
|
its work finethanks a lot |
 |
|
|
|
|
|