select top #url.claimCount# ownerId, ownerType, claimId from richsSupplementalFileClaims order by claimId
Updating #qmd_claims.recordCount# Claims
select pod.ownerId, pod.ownerType, pod.claimId, pod.contractNbr, pod.proofOfDeliveryId, convert( decimal(12,4), pod.itemQty * pod.rebateUnitPrice ) newTotalRebate, pod.totalRebate from tbl_TPM_ProofOfDelivery pod where pod.ownerId = and pod.ownerType = and pod.claimId = and ( pod.itemQty * pod.rebateUnitPrice ) <> pod.totalRebate
Already Done
select distinct ownerId, ownerType, claimId, contractNbr from qmd_proofOfDelivery
Need to update #qmd_proofOfDelivery.recordCount# rows
update tbl_TPM_ProofOfDelivery set totalRebate = where ownerId = and ownerType = and proofOfDeliveryId = and contractNbr = and claimId = and totalRebate = select pod.ownerId, pod.ownerType, pod.claimId, pod.contractNbr, pod.proofOfDeliveryId, convert( decimal(12,4), pod.itemQty * pod.rebateUnitPrice ) newTotalRebate, pod.totalRebate from tbl_TPM_ProofOfDelivery pod where pod.ownerId = and pod.ownerType = and pod.claimId = and ( pod.itemQty * pod.rebateUnitPrice ) <> pod.totalRebate
Still Need to update #qmd_proofOfDelivery.recordCount# rows
delete from tbl_TPM_ClaimContracts where contractNbr = '$MISCELLANEOUS' and ownerId = and ownerType = and claimId = select * from tbl_TPM_Claims where claimId = and ownerId = and ownerType= select * from tbl_TPM_ClaimContracts where claimId = and ownerId = and ownerType= select itemCode, itemQty, itemDescription, rebateUnitPrice, totalRebate, status, flagged, flagComment from tbl_TPM_ProofOfDelivery pod where pod.ownerId = and pod.ownerType = and pod.claimId =