Dynamics NAV

Showing posts with label Date. Show all posts
Showing posts with label Date. Show all posts

Wednesday, 24 December 2014

How to get first day and last day of current and previous month

To get the first day of the current month,

  CALCDATE ('<CM-1M+1D>', Today);

To get the Last day of the current month,

    CALCDATE ('<CM>', Today).

To get the first day of the previous month,


     CALCDATE ('<CM-2M+1D>', Today);

To get the Last day of the Previous month,


       CALCDATE('<CM>',CALCDATE('<-CM-1D>',TODAY)).