The purpose of this blog is for knowledge sharing and connect the relevant audience who are all into Microsoft Dynamics world.
Alfasith AX
Friday, October 17, 2014
Date handling in AX 2012
Hi,
dateStartMth and dateEndMth in ax 2012
//Get day from date
dayOfMth(systemdateget())
//Get month from date
mthOfYr(systemdateget())
//Get year from date
year(systemdateget())
// Ger Ist date of the month
dateStartMth (DueDate); // If DueDate = 18\11\1989 this method returns 01\11\1989
// Get Last date of the month
dateEndMth (DueDate) // If DueDate = 18\11\1989 it returns 30\11\1989
// Get no of months between the 2 dates.
noOfMonths = intvNo(Date1, Date2, intvScale::Month);
// Get no of month between 2 dates belongs to 2 different year.
noOfMonths = intvNo(Date1, Date2, intvScale::YearMonth);
//for next month
dateLoc = nextMth(today());
//for prevous month
dateLoc=prevMth(today());
//for next year
dateLoc=nextYr(today());
//for previous year
dateLoc =preYr(today());
//4 month before
dateLoc=prevQtr(today());
//4 month after
dateLoc=nextQtr(today());
Regards,
dateStartMth and dateEndMth in ax 2012
//Get day from date
dayOfMth(systemdateget())
//Get month from date
mthOfYr(systemdateget())
//Get year from date
year(systemdateget())
// Ger Ist date of the month
dateStartMth (DueDate); // If DueDate = 18\11\1989 this method returns 01\11\1989
// Get Last date of the month
dateEndMth (DueDate) // If DueDate = 18\11\1989 it returns 30\11\1989
// Get no of months between the 2 dates.
noOfMonths = intvNo(Date1, Date2, intvScale::Month);
// Get no of month between 2 dates belongs to 2 different year.
noOfMonths = intvNo(Date1, Date2, intvScale::YearMonth);
//for next month
dateLoc = nextMth(today());
//for prevous month
dateLoc=prevMth(today());
//for next year
dateLoc=nextYr(today());
//for previous year
dateLoc =preYr(today());
//4 month before
dateLoc=prevQtr(today());
//4 month after
dateLoc=nextQtr(today());
Regards,
Subscribe to:
Posts (Atom)
SQL code to upate one Legal entity banner to all the legal entity in D365
Hi, update companyimage set companyimage.Image = companyimageA.Image from ( select Image from companyimage where dataAreaid = 'USF...
-
Hi, AccountingDistribution ( accounting distribution 7452 ) AccountingDistributionEventTmp ( accounting distribution 100001 ) Accountin...
-
Hi, Create a EDT name it Gender then in properties enumType : //select the enum name Use the below code and enjoy. static v...