I have been searching to no avail to find a solution to the problem below (please see attachment for more details). Any help is appreciated - air code, referrals to similar solutions, etc.
Note: Table A gets a single parent record created and the paid default is false (zero). Table B gets one or more child records and the paid default is false (zero). I need to loop through table B and select all the related foreign key child records (these will have the same settlementID on them as shown in table B). Next, I need to test the paid column for true. If ALL are paid (true) then use sql to update parent record paid column to true in Table A. If ALL are not true, (as in fk 2 above then do nothing and move to the next related set of foreign keys in table B (as in 19). The process has to repeat through the whole table B. The goal is to update Table A record when all child records in B have been paid to true.
Note: Table A gets a single parent record created and the paid default is false (zero). Table B gets one or more child records and the paid default is false (zero). I need to loop through table B and select all the related foreign key child records (these will have the same settlementID on them as shown in table B). Next, I need to test the paid column for true. If ALL are paid (true) then use sql to update parent record paid column to true in Table A. If ALL are not true, (as in fk 2 above then do nothing and move to the next related set of foreign keys in table B (as in 19). The process has to repeat through the whole table B. The goal is to update Table A record when all child records in B have been paid to true.
Attachments
Last edited: