Hi,
In my environment, it returns 6 as the following. Did you change your locale in the project?
I guess “-172” is caused by 03/09/2023 is recognized as “dd/MM/yyyy”.
So can you try DateTime.ParseExact instead of Convert.ToDateTime as the following?
DateDiff(DateInterval.Day, DateTime.ParseExact(date_ETADate,"MM/dd/yyyy",System.Globalization.CultureInfo.InvariantCulture), convert.ToDateTime(date_ATADate))
Regards,