See the following SQL statement:
SELECT datediff("d", MAX(invoice.date), Now) As Date_Diff
, MAX(invoice.date) AS max_invoice_date
, customer.number AS customer_number
FROM invoice
INNER JOIN customer
ON invoice.customer_number = customer.number
GROUP BY customer.number
If the following has been added:
HAVING datediff("d", MAX(invoice.date), Now) > 365
does it just exclude rows with Date_Diff <= 365?
What should be the effect of the HAVING clause?
EDIT: I don't experience what they say here. A copy of the mdb file is located at http://hotfile.com/dl/40641614/2353dfc/test.mdb.html (no macros or viruses). To execute queries, VISDATA.EXE is used.
EDIT2: I think the problem may be VISDATA because I experience different results through DAO.
source
share