In my HAVING here I'm trying to only return a row if the max paymentdate is older than 12 months back from today. I don't seem to be able to get it.
If the max paymentdate is 3/14/2010 it should not return a row. But if it was 3/14/2009 is should return a row.
HAVING (MAX(tblPayments.PaymentDate) NOT BETWEEN GETDATE() AND DateAdd(m,-12,GETDATE()))
If the max paymentdate is 3/14/2010 it should not return a row. But if it was 3/14/2009 is should return a row.
HAVING (MAX(tblPayments.PaymentDate) NOT BETWEEN GETDATE() AND DateAdd(m,-12,GETDATE()))