I want to calculate the date difference between two posting date on the Cust. Ledger Entry table. how can i achieve this? this is what i have written so far to get what i want but its not working.
steps:="Cust. Ledger Entry".next(1);
steps := "Cust. Ledger Entry1".next();
start := "Cust. Ledger Entry"."Posting date";
"Cust. Ledger Entry1".next();
enddate := "Cust. Ledger Entry1"."Posting Date";
diff := enddate - start;
0
Comments
31/01/08
29/02/08
23/07/08
28/12/08
If you need the Days between the Start and End you can use also the DATE table
You will need to give us us a more detailed explaination. It sounds like you want to use a matrix form. Have a look at budgets from 113 or the Howto
http://www.mibuso.com/howtoinfo.asp?FileID=13
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
posting date amount
01/01/08 1000
01/04/08 200
i want something that will give me the days different between
01/04/08 - 01/01/08
thanks.. I hope that helps to explain.
Are you doing this in onaftergetrecord of "Cust. Ledger Entry" DataItem?
Are you getting wrong data(Record) printed on report?
start := "Cust. Ledger Entry"."Posting date";
"Cust. Ledger Entry1".next();
enddate := "Cust. Ledger Entry1"."Posting Date";
diff := enddate - start;
By looking at code posted by you, it must have been printing the every second record.
If you are trying to print every record then you have to use
start := "Cust. Ledger Entry"."Posting date";
IF "Cust. Ledger Entry1".next() THEN BEGIN
enddate := "Cust. Ledger Entry1"."Posting Date"
diff := enddate - start;
"Cust. Ledger Entry1".next(-1) // This is to take the Pointer back by one
END ELSE BEGIN
diff := 0;
END;
Regards
Harjot
IF "Cust. Ledger Entry1".next() THEN BEGIN
thanks
Sorry my mistake
Change the Line
IF "Cust. Ledger Entry1".next() THEN BEGIN
To
IF "Cust. Ledger Entry1".next() <> 0 THEN BEGIN
Regards
Harjot