Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Filter AOT query on number of years

$
0
0

Hi, 
I'm working on a shortlisting process for recruitment. For this the requirement states that applicants be filtered on number of experience. 
The input is number of experience required.
The query is applied on HcmPersonProfessionalExperience
Following is the query

query      =   new Query();
qbds       =   query.addDataSource(tableNum(HcmPersonProfessionalExperience));
qbr        =   qbds.addRange(fieldNum(HcmPersonProfessionalExperience,StartDate));

qbr.value(strFmt('(%1 - %2) <= %3',
                fieldStr(HcmPersonProfessionalExperience, EndDate)  ,
                fieldStr(HcmPersonProfessionalExperience,StartDate), 5));

queryRun   =   new QueryRun (query);


This is code I started with. But this filters on number of days.
I tried using SysQueryUtilRange::YearRange , DatetimeUtil::year and year functions but it did not work.

The EndDate and StartDate are transdate
My question: can I filter the query on number of years equal to the experience required.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>