L
Larry Marshall
I can't figure out what I'm doing wrong with this query. I have a
property table joined to a mailings table, one-to-many. The
primary/foreign key is PropKey. The mailings table has a field,
MailDate.
I want to generate a record for each property which has its last (max)
MailDate greater than 21 days from today's date. With the query below,
it is not selecting the max MailDate, but the first.
SELECT Property.Propkey, Max(Mailings.MailDate) AS MaxOfMailDate
FROM Property LEFT JOIN Mailings ON Property.PropKey=Mailings.PropKey
WHERE (DateAdd("d",21,Mailings.MailDate)<Date())
GROUP BY Property.Propkey;
HELP! Larry
property table joined to a mailings table, one-to-many. The
primary/foreign key is PropKey. The mailings table has a field,
MailDate.
I want to generate a record for each property which has its last (max)
MailDate greater than 21 days from today's date. With the query below,
it is not selecting the max MailDate, but the first.
SELECT Property.Propkey, Max(Mailings.MailDate) AS MaxOfMailDate
FROM Property LEFT JOIN Mailings ON Property.PropKey=Mailings.PropKey
WHERE (DateAdd("d",21,Mailings.MailDate)<Date())
GROUP BY Property.Propkey;
HELP! Larry