Query query = new query(querystr(#AOTQueryName)); // Getting Query From AOT ,
QueryBuildDataSource qbds = query.dataSourceTable(tablenum(#TableName)); // Adding More DB
queryBuildRange qbr = qbds.addRange(fieldNum(#TableName,#FieldValidFrom)); // Add Range
qbr.value(strFmt('(%1.%2 <= DateTimeUtil::date("%3"))',tableStr(HcmEmployment),fieldStr(HcmEmployment, ValidFrom),asonDate)); // Passing Value