Starting and Ending Date of Every Month

Hi Everyone,

In a report i have date variable StartDtApr and EndDtApr it will filer the data for the month of April, Same way for the all next month.

I want to set the date by default for StartDtApr := 01042020d EndDtApr := 30042020D i have set it hard coded,

i don’t want it hard coded.

Since you did not ask a question, I can only assume that you like to know how to calculate these certain dates. Try:

startDate := CALCDATE('<-CM>',someDate);
endDate := CALCDATE('<CM>',someDate);

In short i want the starting and ending date of every month

Try search or see the related posts below this. This question has been asked and answered many many times and there are many ways to do it. Here are a few:

https://dynamicsuser.net/nav/f/developers/53115/date-filter-should-accecpt-only-starting-ending-dates-of-a-month
https://dynamicsuser.net/nav/f/developers/95351/calculate-end-date-from-start-date-and-no-of-month-in-nav

https://dynamicsuser.net/nav/f/developers/84332/find-start-date-and-end-date-from-month-text

Dear Mr. Erik,

i had searched earlier but this is not what i actually needed. let me explain in detail what i want,

i have 12 variables monthwise

StartDateApr::
EndDateApr:=
StartDateMay:=
EndDateMay:=
StartDateJune:=
EndDateJune:=
StartDateJuly:=
EndDateJuly:=
StartDateAug:=
EndDateAug:=
StartDateSep:=
EndDateSep:=

For each month i want starting and ending date, i cannot use current month function to set the start and end date bcoz i will run the report every month

Time being i have written hardcoded

StartDateApr:=010420D;

EndDateApr:=300420D;
StartDateMay:=010520D;
EndDateMay:=310520D;
StartDateJune:=010620D;
EndDateJune:=300620D;
StartDateJuly:=010720D;
EndDateJuly:=310720D;
StartDateAug:=010820D;
EndDateAug:=310820D;
StartDateSep:=010920D;
EndDateSep:=300920D;
StartDateOct:=011020D;

Why can’t you use that function? Use variables.

In my report im showing the container details data in which it show for the current month container details and in total is count no of containers

But along with this i want total no of container for all the previous month.