I can't see where you've set i, so shouldn't this line emailaddr:=sups[i]; be emailaddr:=sups[Counter]; You're right that this line will need to be within the loop emps:=@Unique(@DbLookup(""; ""; "LUPinkSheetStatus2"; StartingDate+sups; 2)); Try emps:=@Unique(@DbLookup(""; ""; "LUPinkSheetStatus2"; StartingDate+sups[Counter]; 2));