SELECT AttestInvoice.verNo, AttestInvoice.invoiceCompany, AttestInvoice.storeID, AttestInvoice.invoiceSum, AttestInvoice.invoiceID, AttestAccountInfo.completedDate
FROM AttestInvoice INNER JOIN
AttestAccountInfo ON AttestInvoice.invoiceID = AttestAccountInfo.invoiceID
WHERE (AttestInvoice.storeID > 0) AND (AttestInvoice.storeID IN
(SELECT storeID
FROM EmployeesStoresByUser
WHERE (userName = @userName))) AND (AttestAccountInfo.approved = 1)
OR (AttestInvoice.storeID > 0) AND (AttestInvoice.storeID IN
(SELECT storeID
FROM EmployeesStoresByUser
WHERE (userName = @userName))) AND (AttestAccountInfo.denied = 1)
ORDER BY AttestAccountInfo.completedDate DESC
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.