Здравствуйте, можете привести нормальный пример с Query через этот job
X++:
static void Job674(Args _args)
{
// EmplTable.PayEmploymentDate_RU - дата приема
// EmplTable.PayResignedDate_RU - дата увольнения
EmplTable emplTable;
DirPartyTable dirPartyTable;
int i;
date needDate = 03\01\2017;
;
while select EmplId, MainOrganizationId_UA, PayEmploymentDate_RU
from emplTable
where EmplTable.LaborRelation_UA == LaborRelation_UA::Employee
&&
(
(EmplTable.PayEmploymentDate_RU <= needDate) &&
(EmplTable.PayResignedDate_RU == datenull()|| EmplTable.PayResignedDate_RU >= needDate)
)
join Name from dirPartyTable
where dirPartyTable.PartyId == EmplTable.PartyId
{
info(strfmt('%1 , %2 %3 %4',EmplTable.EmplId, DirPartyTable.Name, empltable.MainOrganizationId_UA,EmplTable.PayEmploymentDate_RU));
i++;
if(i>10)
{
break;
}
}
}