none
Problem with Date Adding RRS feed

  • Question

  • I am having an issue with the following 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"))))))))

    This is part of a report I have made for D365 CRM.

    Basically I want to add months to the "createdon" field based on the "lbmc_payschedule" field value, with Annual adding 12 months, etc. I am not sure where the issue is. Visual Studio does not show an error in the code, but when I run the report, it just shows #error. The expression is in a tablix by itself. Any insight would be greatly appreciated.

    Wednesday, October 9, 2019 3:54 PM

All replies

  • Hi kbeanblossom,

    Could you please share us your table structure and some sample data along with your expected result? So that we’ll get a right direction and make some tests.

    Regards,

    Zoe


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 10, 2019 8:01 AM