--抄表单
delete ASM_NumberBillDetail where ParentBillCode in(
select Code from ASM_NumberBill where BusiDate<'2016-01-01')
delete ASM_NumberBill where BusiDate<'2016-01-01'
--出库单
delete INM_OutBillDetail where ParentBillCode in(
select Code from INM_OutBill where BusiDate<'2016-01-01')
delete INM_OutBill where BusiDate<'2016-01-01'
--工作单
delete PPM_JobBillDetailUserExec where JobBillCode in(
select Code from PPM_JobBill where BusiDate<'2016-01-01'
)
delete PPM_JobBillDetailUsedMaterial where JobBillCode in(
select Code from PPM_JobBill where BusiDate<'2016-01-01'
)
delete PPM_JobBillDetailNumericAssert where JobBillCode in(
select Code from PPM_JobBill where BusiDate<'2016-01-01'
)
delete PPM_JobBillDetail where ParentBillCode in(
select Code from PPM_JobBill where BusiDate<'2016-01-01'
)
delete PPM_JobBill where BusiDate<'2016-01-01'
--结算单
delete RSM_GatheringBill where BusiDate<'2016-01-01'
--结付单
delete SRM_SettlePaymentBillDetail where ParentBillCode in
(
select Code from SRM_SettlePaymentBill where BusiDate<'2016-01-01'
)
delete SRM_SettlePaymentBill where BusiDate<'2016-01-01'
--销账单
delete RSM_SettleGatheringBillDetail where ParentBillCode in(
select Code from RSM_SettleGatheringBill where BusiDate<'2016-01-01'
)
delete RSM_SettleGatheringBill where BusiDate<'2016-01-01'
--零售单
delete RSM_PettyGatheringBill where BusiDate<'2016-01-01'
--凭证单
delete FAM_CredenceBillDetail where ParentBillCode in(
select Code from FAM_CredenceBill where BusiDate<'2016-01-01'
)
delete FAM_CredenceBill where BusiDate<'2016-01-01'
--入库单
delete INM_InBillDetail where ParentBillCode in(
select Code from INM_InBill where BusiDate<'2016-01-01'
)
delete INM_InBill where BusiDate<'2016-01-01'
--收入单
delete FAM_IncomingBill where BusiDate<'2016-01-01'
--退款单
delete RSM_RefundmentBill where BusiDate<'2016-01-01'
--维护单
delete ASM_MaintenanceBill where BusiDate<'2016-01-01'
--物流单
delete PPM_LogisticsBill where BusiDate<'2016-01-01'
--应付单
delete SRM_ChargeUpPaymentBill where BusiDate<'2016-01-01'
--用料单
delete INM_UsedBillDetail where ParentBillCode in(
select Code from INM_UsedBill where BusiDate<'2016-01-01'
)
delete INM_UsedBill where BusiDate<'2016-01-01'
--预存单
delete RSM_PreGatheringBill where BusiDate<'2016-01-01'
--支出单
delete FAM_OutgoingBill where BusiDate<'2016-01-01'
--转账单
delete FAM_TransferBill where BusiDate<'2016-01-01'