I have a SQL statement that I am attempting to utilize three different querystrings to return results. Problems are I need the WHERE statement to use only one querystring when two are present. The url looks like '/ArticleID/4/PageID/6/' when two parameters are present and '/ArticleID/4/' when only one is present. What I need to do is listen for both parameters but when the pageid is present I need to ignore the articleID and when the articleid is present I need it to pull the match. Code I am using now is below and the only issue with it is that when the articleID and PageID are present it grabs both results, which I can't have in this instance. Any advice would be appreciated.
WHERE articleID = '[Query:articleID]'
OR Page = '[Query:PageID]'
OR CategoryID = '[Query:CategoryID]'