SELECT VENDTABLE.ACCOUNTNUM AS VENDORID, DIRPARTYTABLE.NAME AS NAME,
LOGISTICSELECTRONICADDRESS.LOCATOR AS EMAILADDRESS
FROM DIRPARTYTABLE AS DIRPARTYTABLE INNER JOIN
VENDTABLE ON DIRPARTYTABLE.RECID = VENDTABLE.PARTY INNER JOIN
DIRPARTYLOCATION ON DIRPARTYTABLE.RECID = DIRPARTYLOCATION.PARTY INNER JOIN
LOGISTICSELECTRONICADDRESS ON DIRPARTYLOCATION.LOCATION = LOGISTICSELECTRONICADDRESS.LOCATION
where LOGISTICSELECTRONICADDRESS.TYPE = 2
ORDER BY DIRPARTYTABLE.NAME