Hi
I have a statement somthing like this
Code:sSQL="SELECT * FROM tbllinks where tbllinks.Active = 'Y' and Name like '%" & sKeywords & "%'" & _ "or URL like '%" & sKeywords & "%'" & _ "or Description LIKE '%" & sKeywords & "%'" & _ "or Keywords LIKE '%" & sKeywords & "%'" & _ "or Contact_Name LIKE '%" & sKeywords & "%'" & _ "or Contact_Email LIKE '%" & sKeywords & "%'" & _ "or hit LIKE '%" & sKeywords & "%' order by hit desc;"
it's supposed to select only those who have Y value in Active colum however it also selects those who have N value.
I also tried this one:
Code:sSQL="SELECT tbllinks.ID,tbllinks.Name,tbllinks.URL,tbllinks.Description,tbllinks.Keywords,tbllinks.Contact_Name,tbllinks.Contact_Email,tbllinks.hit FROM tbllinks where tbllinks.Active = 'Y' and Name like '%" & sKeywords & "%'" & _ "or URL like '%" & sKeywords & "%'" & _ "or Description LIKE '%" & sKeywords & "%'" & _ "or Keywords LIKE '%" & sKeywords & "%'" & _ "or Contact_Name LIKE '%" & sKeywords & "%'" & _ "or Contact_Email LIKE '%" & sKeywords & "%'" & _ "or hit LIKE '%" & sKeywords & "%' order by hit desc;"
what is wrong in this statement?


Reply With Quote
Bookmarks