web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

SSRS Report Problem

(0) ShareShare
ReportReport
Posted on by

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:

2019_2D00_10_2D00_09-11_5F00_03_5F00_06_2D00_Window.png

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

I have the same question (0)
  • kdbeanblossom Profile Picture
    on at

    I forgot to mention this is an ssrs report.

  • Suggested answer
    Kipetcoff Profile Picture
    1,037 on at

    Hi, 

    It's not clear from you expression what is the type of field Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value

    Here you compair it with number Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value=1

    Later you getting year from it

    Year(Fields!LE_b9e1170c97b3c08492417b05e31de48e_lbmc_payschedule.Value)

    Please check you expression part by part

  • David Jennaway Profile Picture
    14,065 on at

    Is the lbmc_payschedule field an OptionSet ? If so, you should use lbmc_payscheduleValue.Value to get the numeric value

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans