Wednesday, March 21, 2012

Need correction...

I want to display a list of member after filtering two condition...

1) Select MID from TableMember where AID value EQUAL to Dropdownlist.value
2) Select MID from TableStatus where AID NOT EQUAL to Label.Text

I try something like this... is not working... Can anyone correct the statement for me...

"Select * from VIEW1 where MID in (Select MID from TableMember where Aid='" & Ddl1.SelectedItem.Value & "') and MID not in(select Mid from TableStatus where Aid <>'" & Label.Text & "')"

Thank you...do TableMember and TableStatus have the same MID column ?

if so, try


select tablemember.* from tablemember,tablestatus
where tablemember.mid=tablestatus.mid and
tabmemember.aid=@.dpval and tablestatus.aid <> @.label

and pass the parameters accordingly.

hth|||Yes, TableMember and TableStatus have the same MID column

But one more thing is I am using a VIEW from SQL Server.

Which I think you have left out ?|||treat it as a table and add another join stmt to join the view with the other tables...

hth

No comments:

Post a Comment