If you have a table with your customer details in (unique codes) you could either run for all or selected, or even between dates, whichever query you run,
but you could do it like this
A = id table
B = sales table
open A, goto first record,
do while not A.eof
dim personID
personID =...