afaik you can not do a sql to return a list of transactions to equal to a given total
though you could easily do a sum of both trade alloc and tradeexec for a client, and if equal, simple do the rest

if not equal then
assuming that tradealloc is always > for each client:-
the only way i would know to do it is to get a recordset to sum the qty of tradealloc for each client, then loop a recordset of tradeexec for the same client, to try to match values

someone in the database forum may have better suggestions