5 Replies Latest reply: Mar 12, 2015 1:28 AM by Rekha Harish RSS

    How to calculate the number of months between two dates

      Hi,

       

      I have a below requirement.

       

      From_dt To_dt Value
      1/1/2015 1/3/2015 3000
      14/1/2015 20/10/2015 20000
      7/3/2015 12/5/2015 6000
      10/2/2015 10/11/2015 9000

       

      For eg:when I select 1/1/2015 then I need to find the number of months from from_dt to to_dt then distribute the values equally for those months i.e I will consider from Jan to Mar as 3 months and have to display the output as below.

      Jan 2015  Feb 2015  Mar 2015

      1000          1000           1000

       

      Note:Date is in dd/mm/yyyy format.