Calculated Field to Show Yes or No


  • Hello, 

    I am using SQL Server Report Build 2012 and I am attempting to create an IF then statement(if there is a thing) that returns a value of yes or no based on dates. I am building a report for On time Delivery based on the customers required date and our actual shipped date. See below example and function I have attempted.

    Data Needed: If the Required Ship Date is less than or equal to the actual ship date then YES otherwise No. 

    i.e. Required Date is 1/1/18

          Actual Ship Date is 12/31/17

          On Time Result: YES

    i.e. Required Date is 1/1/18

          Actual Ship Date is 1/31/18

          On Time Result: No

    Here is my current argument:

    =IIF(Fields!ACTLSHIP.Value<=Fields!ReqShipDate.Value , 'YES', 'No')

    When I run the report I get the error: "The Value expression for the filed 'ONTIME' contains an error:[BC30201] Expression expected."

    I gather this means I need something else in my function. What is it? Is there a better function that I can create? Can anyone help me?

     Kyana Brooks

    Wednesday, September 12, 2018 11:28 PM

All replies

  • Hi KyanaBrooks,

    In your expression, did above expression are "ONTIME" field? If so, you need to use expression like below to check this issue

    =IIF(Fields!ACTLSHIP.Value<=Fields!ReqShipDate.Value , "YES", "No")
    Best Regards,
    Zoe Zhi

    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

    Thursday, September 13, 2018 1:31 AM
  • Thank you for the assistance with this. It worked Zoe. 

    KYANA BROOKS Operations Manager

    Wednesday, October 24, 2018 5:33 PM