I have the following formula DATEDIF(Due Date, Invoice Date, D) in a connector Excel formula expression. The Invoice Date and Due Date are SQL expressions like this CAST(CAST([APOBS].[DATEINVC] AS varchar) AS datetime). When I run the report I get #value in the resulting column in Excel. How can I get the difference between two different Dates using Sage 300.