Search This Blog

Monday, April 21, 2014

How to Calculate the time for the particular query time in Dynamics Axapta

Hi Folks,

How to Calculate the query timings ,how much time its working.

Check the below code you can identify :)

static void DateSplit(Args _args)
{
  date fixDate,fromdate,todate;
  int i,j;
  int         day,month,years;
  utcDateTime         jobStart, JobEnd;
  int64               jobRuntime;
  ;
    jobStart = DateTimeUtil::utcNow();
  fixDate = 22\1\2014;//systemDateGet();
  day = dayOfMth(fixDate);
  month = mthOfYr(fixDate);
  years = year(fixDate);

  info(strFmt("%1",day));

    if(day <=15)
    {
        fromdate = mkDate(1,month,years);
        todate   = mkDate(15,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
    else if(day <= 31)
    {
        fromdate = mkDate(16,month,years);
        todate   = mkDate(31,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
     jobEnd = DateTimeUtil::utcNow();
    jobRuntime = DateTimeUtil::getDifference(JobEnd, jobStart);
    info(strFmt("JOB DONE IN %1 SECONDS", int642str(jobRuntime)));
}

OutPut:























Thanks
Happy Daxing..!

No comments:

Post a Comment