calc difference between two date

AM CORONTLY GO TO CREAT A REPORT BASED ON TABLE Purchase Line IN NAV CLASSIC CLIENT (2009 R2) THE OBJECTIV OF REPORT IS TO CALC DIFFERENC BETWEEN TWO POSTINGE DATE
PLEAS HELP ME IF ADD WITH C/AL GIVE ME THIS LINE IF NOT OR WITH ANOTHER IDEA TRANSFERT TO ME
THANK YOU

Hey abdelkrim,

Difference between two Posting dates means you want to know the difference in days between the two dates??

yes

Did you checked this link

forum.mibuso.com/…/calculate-difference-between-two-dates

If its DateTime then I believe Duration Data Type will be the best part to use but it wont be a Integer Value.

Actually there’s link in DUG as well

dynamicsuser.net/…/how-to-calculate-the-difference-between-two-date

yes but when add this code as on table(name of new field’s) or when thank to give an exemple correclty

Sorry I didn’t understood completely but I think you want to know when and where to add this code right??

When you want to get this executed??

i need to creat a report in classic client , and add a textbox to calc difference between two date ,the report based on table purchas line ,

As per my understanding of your question. You need to know how to calculate difference between two dates as No. of Days and need to show in the report.

To Achieve this.

Create three variables, lets say: ToDate as Date type, FromDate as Date type and No.ofDays as Integer type. after write a code like below.

No.OfDays := ToDate - FromDate;

SourceExpression property of the textbox in report: refer to No.OfDays field.