Skip to Content
0
Former Member
Jan 25, 2017 at 08:32 PM

A start /end routine to delte/exclude fields with same values

407 Views

Hello ,

I'm new to start/end routine, and I would appreciate if some helps with a routine to do the following clean up:

I have a table with the following fields:

Product Id (PROD_ID), Assignment Number (ASSNo), Document Number (DOC_NO), Balance.

The routine would perform the following :

Loop into the table, find all the records for which product ID are the same, then:

If more than one record has the same ASSNo and the sum (balance) = 0, delete them, otherwise keep one of the record and the balance.

IF product Id is the same, and the Assno are different, but they records have the same DOC_NO, and the sum (balance) = 0, delete them, otherwise keep one of the record and the balance.

if no records with the same PROD_ID, then load everything .

Thanks in advance for your help.

JHN