Hi friends
Today we are going to convert dates in Ax 2009. Below I am going to publish a simple program for that . Paste the following program in Job and go through it.
Display str balanceDate()
{
str day;
str month;
str currentYear;
str datevalue;
int i;
transdate StartMonth;
str year_format;
;
if(salarymonth)
{
StartMonth = Global::dateStartMth(salarymonth);
day = int2str(dayofMth(any2date(StartMonth)));
month = substr(mthname(mthofyr(any2date(StartMonth))),1,3);
currentYear = int2str(year(any2date(StartMonth)));
year_format = substr(currentYear,3,2);
for(i=1; i<=3; i++)
{
switch(i)
{
case 1:
datevalue += day ;
datevalue += ' ';
break;
case 2 :
datevalue += month;
datevalue += ' ';
break;
case 3:
datevalue += year_format;
break;
}
datevalue = datevalue;
}
}
return datevalue;
}
I hope after seeing the program you will understand a lot more about it.
Vivek Chirumamilla
No comments:
Post a Comment