No real code here right now, just a quick and dirty concept to make the code.
=======================================
Make a loop to do the following for each company:
Retrieve the following records for each company. Make a string of IF's checking for
IF Select titleID number =460 then tag to send letter, else
IF Select titleID number =360 then tag to send letter, else
IF Select titleID number =390 then tag to send letter, else
IF Select titleID number =520 then tag to send letter, else
No one in this company qualifies, end loop, go to next company till all companies are done.
The "tagged" records could be appended to a temporary table for label printing, vs. just "tagging" in some manner. Sanity check would be 6107 records in temp table for 6107 companies.
|