Query Error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY SortOrder' at line 14

The query attempting to execute was:
SELECT PageID, MenuLabel, Target, ShortName, SubNavName, SubNavAlt, IF(PageLink<>'', IF( PageType='URL',PageLink, CONCAT(PageLink,'?pg=',PageID) ), ShortName) as MenuURL FROM tblPage, tblPageOutline WHERE tblPageOutline.ChildID = tblPage.PageID AND tblPageOutline.ParentID = 10 AND tblPage.Visible = 'Y' AND MenuID = ORDER BY SortOrder

Script failed on line 413