report builder expression

  • hello everyone -

    The user just happened to find a bug in my report. Here’s what happened : The below expression was written to handle cases when the end date is greater than start date. However, I don’t have the code to handle cases when end date is the same as start date. My question is, can I use the IIF statement in report expression in such a way:

    If end date > start date then

    Use my existing code

    Else if end date = start date then

    Use my new code

    How would I add the IIF statement to make it work?

    =Switch(First(Fields!Work_Center.Value, "DataSet1") = "AZ1", 16000 * (12 - left(Parameters!starttime.Value,1) + left(Parameters!endtime.Value,1) - 1),First(Fields!Work_Center.Value, "DataSet1") = "AZ2",18000 * (12 - left(Parameters!starttime.Value,1) + left(Parameters!endtime.Value,1) - 1),(First(Fields!Work_Center.Value, "DataSet1") = "GAV1" or First(Fields!Work_Center.Value, "DataSet1") = "GAV2"),8000 * (12 - left(Parameters!starttime.Value,1) + left(Parameters!endtime.Value,1) - 1),First(Fields!Work_Center.Value, "DataSet1") = "GAV3",10000 * (12 - left(Parameters!starttime.Value,1) + left(Parameters!endtime.Value,1) - 1),First(Fields!Work_Center.Value, "DataSet1") = "ZED",9600 * (12 - left(Parameters!starttime.Value,1) + left(Parameters!endtime.Value,1) - 1))

    Any help would be greatly appreciated.

  • =IIF(Enddate.value> Startdate.value,swith(............),IIF(Endate.value=Startdate.value,newexpression))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply