I was browsing through the questions and noticed this:
SELECT prodid, issue FROM Sales WHERE custid = @custid AND datesold = SELECT MAX(datesold)
You may be used to MySQL's syntax: Microsoft SQL @ is the same as the MySQL's ?
@
?