解决方案: | 检查没有被取到数字的材料出库单号 sELECT distinct RdRecord.ccode,RdRecords.cinvcode,RdRecords.iquantity,RdRecords.citemcode FROM RdRecord INNER JOIN RdRecords ON RdRecord.ID = RdRecords.ID WHERE RdRecord.cVouchType = ’11’ AND RdRecord.dDate >= CONVERTDATETIME, ‘2003-12-01 00:00:00′, 102 AND RdRecord.dDate <= CONVERTDATETIME,'2003-12-31 00:00:00', 102 –group by RdRecords.cInvCode,RdRecords.citemcode –having and not existsSELECT [cMatID], b.[citemcode], [iQua] FROM [CA_MaBSW] a join [fitemss99] b on a.[cPPID]=b.[citemname] where iperiod=12 and RdRecords.cinvcode=[cMatID] and Records.citemcode=b.[citemcode] sELECT distinct RdRecord.ccode,RdRecords.cinvcode,RdRecords.iquantity,RdRecords.citemcode FROM RdRecord INNER JOIN RdRecords ON RdRecord.ID = RdRecords.ID WHERE RdRecord.cVouchType = ’11’ AND RdRecord.dDate >= CONVERTDATETIME, ‘2003-12-01 00:00:00′, 102 AND RdRecord.dDate <= CONVERTDATETIME,'2003-12-31 00:00:00', 102 –group by RdRecords.cInvCode,RdRecords.citemcode –having and not existsSELECT [cMatID], b.[citemcode], [iQua] FROM [CA_MaBSW] a join [fitemss99] b on a.[cPPID]=b.[citemname] where iperiod=12 and RdRecords.cinvcode=[cMatID] and Records.citemcode=b.[citemcode] |
---|