|
|
where t1.fstatus in('ÉóºË','¹Ø±Õ') and t3.fstatus='¹Ø±Õ' and t1.siteid=@siteid
|
|
where t1.fstatus in('ÉóºË','¹Ø±Õ') and t3.fstatus='¹Ø±Õ' and t1.siteid=@siteid
|
|
|
and CONVERT(VARCHAR(10),t3.fdate,120)<=CONVERT(VARCHAR(10),DATEADD(mm,-12,getdate()),120) and isnull(t4.famount,0)-isnull(t4.FWRITEOFFAMOUNT1,0)>0 group by t1.fagentnum,t1.fsaler) t6 on t7.fagentnum=t6.fagentnum and t7.fsaler=t6.fsaler and isnull(t6.famount5,0)>=0
|
|
and CONVERT(VARCHAR(10),t3.fdate,120)<=CONVERT(VARCHAR(10),DATEADD(mm,-12,getdate()),120) and isnull(t4.famount,0)-isnull(t4.FWRITEOFFAMOUNT1,0)>0 group by t1.fagentnum,t1.fsaler) t6 on t7.fagentnum=t6.fagentnum and t7.fsaler=t6.fsaler and isnull(t6.famount5,0)>=0
|