6357266140751701090762015-07-16T16:36:47.447761900-01-01T00:00:00000falsefalse6357266140751701090762015-07-16T16:36:47.447761900-01-01T00:00:00000Moidfiyfalse30天未跟踪的客户select a.* from (select a.id, rtrim(a.Code) 客户编号,rtrim(a.ClientName) 客户名称,rtrim(b.UserENName) 负责人,CONVERT(varchar(100),a.CreatedDate, 23) 日期 from dbo.t_bse_Client a left join dbo.t_bse_user b on a.OperationMan=b.id) a,(select MAX(a.maxDate) maxDate,a.Id from(select max(RunAfterDate) maxDate,a.id from t_bse_Client a , t_log_ClientRunAfter b where a.id=b.ParentId group by a.id union all select a.maxDate,b.ParentId id from (select max(ReceiptDate) maxDate,MailFrom from t_mail_MailIndex m where m.MailFrom in (select Email from t_bse_ClientLinkman) group by MailFrom) a,t_bse_ClientLinkman b where a.MailFrom=b.Email) a group by Id) b where a.Id=b.Id and b.maxDate between DateAdd(dd,-60,getdate()) and DateAdd(dd,30,getdate())false<ArrayOfWhereObj xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />select a.* from (select a.id, rtrim(a.Code) 客户编号,rtrim(a.ClientName) 客户名称,rtrim(b.UserENName) 负责人,CONVERT(varchar(100),a.CreatedDate, 23) 日期 from dbo.t_bse_Client a left join dbo.t_bse_user b on a.OperationMan=b.id) a,(select MAX(a.maxDate) maxDate,a.Id from(select max(RunAfterDate) maxDate,a.id from t_bse_Client a , t_log_ClientRunAfter b where a.id=b.ParentId group by a.id union all select a.maxDate,b.ParentId id from (select max(ReceiptDate) maxDate,MailFrom from t_mail_MailIndex m where m.MailFrom in (select Email from t_bse_ClientLinkman) group by MailFrom) a,t_bse_ClientLinkman b where a.MailFrom=b.Email) a group by Id) b where a.Id=b.Id and b.maxDate between DateAdd(dd,-60,getdate()) and DateAdd(dd,30,getdate())008A