How to find the Start date and End Date of the Current month

chandrurecchandrurec Member Posts: 560
Hi all,

I am getting the date from the user. Based on the entered date , I want to find the Start date and End Date for the repective current month. Is it possible to find the start date and end date of the current month based on the entered date.

Thanks in advance.

Regards,
Chandru.

Comments

  • diptish.naskardiptish.naskar Member Posts: 360
    Hi,

    use the DATE2DMY to get the Motn and Year and store in a defined variables of type integer and then use the DMY2DATE to get the start date, obvious that the Start date is going to start with 01, and then you can go on using the CALCDATE function to get the end date of the month and year.

    Hope this helps
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
  • swjswj Member Posts: 68
    Hi,

    Do you want to get First Date and End Date of the month or from Current Account Period?

    If your answer is the first then use this. I got from Navision Girl and it works.

    CALCDATE ('CM', date) will return the last day of the month.

    To get the first day of the month,
    use CALCDATE ('CM-1M+1D', date);
  • UltramayankUltramayank Member Posts: 28
    Hi,
    Heres how it can be done
    LastDate:=CALCDATE('CM',YourDate);
    FirstDate:=CALCDATE('-CM',YourDate);
    
    Hope this helped.

    Mayank
    http://extremeengineers.net
    Mayank Bhardwaj
    Visit My Blog at
    http://extremeengineers.net/
Sign In or Register to comment.