Callculate No Of Days

Can anyone please suggest, in my Chart of accounts ledger report where i have number of transactions in different dates, i want to know the difference of no of days in each transaction.

For example:-

Date Description No Of Days

01/04/2016- ist transaction 14(15/04/2016-01/04/2016)

15/04/2016 - 2nd transaction 46(31/05/2016-15/04/2016)

31/05/2016- 3rd transaction

Thanks in advance.

you can simply create no. of days as an integer datatype variable and add code like
noofdays := Date2 - Date1;

so your question is you want to find the number of days difference between 1st and 2nd transaction and so on??

yes exactly…but the confusion here is there is only one field of posting date, how would i subtract the same field?

but the confusion here is there is only one field of posting date, how would i subtract the same field?

you should get it from next line…

can you please guide me how?

You can use another variable of type Record to get the next record and find the difference in the date fields of the current record and next record.

do i need to put any sort of conditioning in it?

it depends upon how do you need it.
account wise or only posting date?

it would be account wise and then posting date.

then you need to sort on G/L Account No.,Posting Date