解决方案: |
update ia_subsidiary
set ia_subsidiary.bflag=1
FROM (((((IA_EstiSettle INNER JOIN Inventory ON IA_EstiSettle.cInvCode = Inventory.cInvCode) left Join PurBillVouchs On IA_EstiSettle.iBSid=PurBillVouchs.Id) Left JOIN RdRecords ON IA_EstiSettle.iRdsID = RdRecords.AutoID) left join ia_subsidiary on rdrecords.autoid=ia_subsidiary.id) left join rdrecord on rdrecords.id=rdrecord.id) WHERE (((Purbillvouchs.bExBill=1 and isnull(IA_EstiSettle.iRdsid,0)=0) or (Purbillvouchs.bExBill=1 and isnull(IA_EstiSettle.iRdsid,0)<>0 and (ia_subsidiary.cvoutype=''01'' or ia_subsidiary.cvoutype=''33''))) or (isnull(IA_EstiSettle.iRdsid,0)<>0 and (ia_subsidiary.cvoutype=''01'' or ia_subsidiary.cvoutype=''33''))) and IA_EstiSettle.dSVDate<=''2006-12-25'' AND (IA_EstiSettle.bAccount=0) and (isnull(IA_EstiSettle.iSVQuantity,0)<>0 or isnull(IA_EstiSettle.iSVPrice,0)<>0) AND ((Purbillvouchs.bExBill=1) or (rdrecord.cbustype=''受托代销'' |