No. Months Calculation Between Two Dates

KumarAlagarsamy
KumarAlagarsamy Member Posts: 3
hi guys

i have to calculate No. of months between Two dates called "Loan Date" and "Salary Date". Suppose "Loan Date" is 5/10/2004 and "Salary Date" is 30/10/2006, i need to calculate No. of Month available between these two date.

Is there any functions available in navision to calculate months between two date?. kindly help me to rectify this problem.

Comments

  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    It depends on the rounding, does 30-9 to 2-10 is 2 months?

    You can use the date table with the filter on months and set filters with DMY2DATE(); and then count the no. of records.
  • KumarAlagarsamy
    KumarAlagarsamy Member Posts: 3
    hai Mark :D:D

    the rounding is exactly correct what u said.

    could u please explain how to set filter to get Months?

    regards
    Kumar
  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    In Navision there is a virtual table named Date [2000000007]. Or something in your language.

    this contains all days, weeks, months and years between 01010000 and 31129999.

    If you filter this table on months starting from the first day of the first month and ending at the first day of the last month you should be able to count the records resulting in the no. of months.

    Try to create a form on this table and you'll see.