Please see my SQL query below:
SELECT inv.InvoiceNumber, inv.VendorName, inv.DateSubmitted, inv.DateCheckRequested, inv.IM_Check_Confirmed_Date, inv.NetItemAmount, DateDiff("d",[DateSubmitted],[DateCheckRequested]) AS PaymentTime, sum (inv.InvoiceNumber)
FROM tblInvoicesSubmitted AS inv
WHERE (((DateDiff("d",[DateSubmitted],[DateCheckRequested]))<=15) AND ((inv.[NetItemAmount])<=100))
GROUP BY inv.InvoiceNumber;
When I try to run the query it keeps say that Vendor Name or Date Submitted are not part of the aggregate function? Additionally, I want to group by invoice number so there are not repeats and then I want to count the number of unique invoice numbers after they have been grouped. Please advise on the appropriate SQL syntax. Appreciate the help.