我正在尝试确保正确发送通信。 我在EmailMain中有一封电子邮件列表,需要在团队到达之前几天将其发送给我的团队负责人。 我想创建一个提醒列表或可能的条件格式,以提醒我需要发送更多电子邮件。
我知道我在下面包含的查询不正确。我只是将其添加为起点。
涉及的表。
EmailLog
EmailLogID
EmailMainID
EmailDate
TeamDetailsID
EmailMain
EmailMainID
EmailSubject
AdvanceDays
TeamDetails
TeamDetailsID
ArriveDate
SELECT EmailMain.EmailMainID, EmailMain.AdvanceDays, EmailLog.SentDate, EmailLog.TeamDetailsID, TeamDetails.ArriveDate
FROM TeamDetails INNER JOIN (EmailMain RIGHT JOIN EmailLog ON EmailMain.EmailMainID = EmailLog.EmailMainID) ON TeamDetails.TeamDetailsID = EmailLog.TeamDetailsID
WHERE (((EmailLog.TeamDetailsID)=39))
ORDER BY EmailMain.AdvanceDays DESC;