А такой метод не подойдет?
X++:
static void Job150(Args _args)
{
custInvoiceJour custInvoiceJour;
while select count(recid) from custInvoiceJour group by salesid
where custInvoiceJour.InvoiceDate > mkdate(1,10,06)
{
if (custInvoiceJour.RecId > 1)
info(strFmt('%1 %2 ',
custInvoiceJour.SalesId,
custInvoiceJour.RecId));
}
}