Your last INNER JOIN
is out of place. The order of elements in a SQL query is that joins come before the WHERE
clause, and there is only one WHERE
clause. End your query with this and the error should go away:
INNER JOIN Cust c
ON v.scnum = c.cnbr
INNER JOIN cont d
ON c.cnbr = d.cnbr
WHERE
current_date - c.cust_acct_crte_dt <= 730 AND
d.role = 'PS';