Hello, I am creating an invoice as a report in D365 for Sales, and I'm running into an issue with a particular expression. Here is the expression:
=(IIf(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value=1, "Annual",(IIf(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value=2, "Semi-Annual","Quarterly")))) & " Membership Dues covering " & DateAdd(DateInterval.Month, 2, DateSerial(Year(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), Month(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), "1")) & " through " & (IIf(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value=1, Dateadd("yyyy", 1, DateAdd(DateInterval.Month, 2, DateSerial(Year(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), Month(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), "1"))),(IIf(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value=2, Dateadd("m", 6, DateAdd(DateInterval.Month, 2, DateSerial(Year(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), Month(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), "1"))),(Dateadd("m", 3, DateAdd(DateInterval.Month, 2, DateSerial(Year(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value), Month(Fields!createdon.Value), "1"))))))))
Basically, I want this to add months to the date field createdon based on the value of the lbmc_payschedule field. Annual being 12 months, Semi-Annual 6 months, and Quarterly 3 months (obviously), however when I run the report it just shows #error. I am not sure why. Visual Studio shows no errors in the expression so I'm not sure where the disconnect is. If anyone has any insight I would greatly appreciate it.
Here is what the error looks like in the report:

The expression is in a tablix of it's own with no border.