Reports and Date

Hello, I have a question about using date in a report. What i want is to see how many days are between 23/12/04 and 12/01/05 I am thinking at: gDecReqShip := “Sales Shipment Header”.“Posting Date” - “Sales Line”.“Requested Delivery Date”; But Navision comes with The Date is not valid! The report only have to show the 21 days! Can anyone help me with this? [:)]

What is the DataType of the gDecReqShip Variable? Is it a Decimal Variable? Change it to Integer and it should work.

It is Decimal. And i have already tried it with DataType = Integer, but the same message came. Is it possible the message is coming, because one of the dates are empty? And if one of the two date is empty, how can i skip them?

Yes, both dates must be filled in or an error will be raised. You can check the dates like this: IF ("Sales Shipment Header"."Posting Date" <> 0D) AND ("Sales Line"."Requested Delivery Date" <> 0D) THEN gDecReqShip := "Sales Shipment Header"."Posting Date" - "Sales Line"."Requested Delivery Date";

many thanks, it’s working