Hi there, I hope someone can tell me what I'm doing wrong here.
I have a SelectCommand in my asp.net page (v4) that pulls a variable from the Profile to run a subquery to get the value to test within the main query. (Confused yet?) This works for 2 of the possible variable but doesn't for the others for some unknown reason. Please could somebody offer some suggestions on what may be the problem?
Here's my code:-
SELECT Act_ID, Act_Name, Genre_ID_1, Genre_ID_2, Genre_ID_3 FROM Acts WHERE (Genre_ID_1 = (SELECT Genre_ID FROM Genres WHERE (Genre_Name = @Genre1))) OR (Genre_ID_2 = (SELECT Genre_ID FROM Genres AS Genres_2 WHERE (Genre_Name = @Genre1))) OR (Genre_ID_3 = (SELECT Genre_ID FROM Genres AS Genres_1 WHERE (Genre_Name = @Genre1)))