Hi guys,
many thanks to all who've helped me so far.
I recently upsized my mdb to adp and need help converting this query to a stored procedure:
SELECT F.Date, F.Status, F.Notes, C.FirstName, C.LastName, C.HomePhone
FROM (Contacts AS C INNER JOIN tblFilmStatus AS F ON C.ContactID = F.ContactID) INNER JOIN [SELECT ContactID, Max([Date]) As LastDate FROM tblFilmStatus
WHERE [Date]<Date()-8 AND Status<>'Received' GROUP BY ContactID
]. AS L ON (F.Date = L.LastDate) AND (F.ContactID = L.ContactID)
WHERE F.Status<>'Received';
thanks!
many thanks to all who've helped me so far.
I recently upsized my mdb to adp and need help converting this query to a stored procedure:
SELECT F.Date, F.Status, F.Notes, C.FirstName, C.LastName, C.HomePhone
FROM (Contacts AS C INNER JOIN tblFilmStatus AS F ON C.ContactID = F.ContactID) INNER JOIN [SELECT ContactID, Max([Date]) As LastDate FROM tblFilmStatus
WHERE [Date]<Date()-8 AND Status<>'Received' GROUP BY ContactID
]. AS L ON (F.Date = L.LastDate) AND (F.ContactID = L.ContactID)
WHERE F.Status<>'Received';
thanks!