AX – D365FO – Get first and last day of a month

X++ Get Start Date and End Date of Month

Use following methods to get Month Start Date and Month End Date. Pass any date of month in parameter.

Month Start Date : 

 TransDate dateInMonth=today();  
 TransDate firstDateOfMonth;  
 firstDateOfMonth = DateStartMth(dateInMonth); 

Month End Date :

 TransDate dateInMonth=today();  
 TransDate endDateOfMonth;  
 endDateOfMonth= endmth(dateInMonth);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s