I have this SELECT statement that is pulling out data from a DB table. This code returns 5 records.
I found that I need to add another qualifier in the WHERE clause from another table so I created this statement.
This code returns 895 records. Thats 179 copies of each of the 5 records. It should return 4 records as one should be hidden.
Not sure what is causing the extra records.
Thanks,
Ty
VB.NET:
"SELECT ITEM_DETAILS, PRIORITY, DUEDATE, COMPLETEDON, ISCOMPLETE, LISTID, COMPLETEDBY, TOTALCOST, COMMENTS
FROM TODO
WHERE (ISCOMPLETE = @ISCOMPLETE) AND (ISDEPARTMENT ='True') AND (ISUSER ='False') AND (MEMBERS LIKE '%' + @Fullname + '%')
ORDER BY SUBMITTEDON DESC"
I found that I need to add another qualifier in the WHERE clause from another table so I created this statement.
VB.NET:
SELECT TODO.ITEM_DETAILS, TODO.PRIORITY, TODO.DUEDATE, TODO.COMPLETEDON, TODO.ISCOMPLETE, TODO.LISTID, TODO.COMPLETEDBY, TODO.TOTALCOST, TODO.COMMENTS
FROM TODO, TODO_SUB_ITEMS
WHERE (TODO.ISCOMPLETE = 'False') AND (TODO.ISDEPARTMENT ='True') AND (TODO.ISUSER ='False') AND (TODO.MEMBERS LIKE '%' + @Fullname + '%') AND (TODO_SUB_ITEMS.HIDE NOT LIKE '%' + @Fullname + '%')
ORDER BY TODO.SUBMITTEDON DESC
This code returns 895 records. Thats 179 copies of each of the 5 records. It should return 4 records as one should be hidden.
Not sure what is causing the extra records.
Thanks,
Ty