two conditions

  • I am trying to write an expression based on two conditions

    =sum(Iif(trim(Fields!payrolcd.Value = "SALARY" and (trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

    This doesn't seem to work. It keeps giving me a syntax error after the comma after the last salary

    So if payrolcd= salary and PAYRCORD = salary i want to sum Untstopy

  • it look like you are missing the closing ')' for your first TRIM

  • Remove the ( before the 2nd trim

  • It tells me wrong number of arguments

  • =sum(Iif(trim(Fields!payrolcd.Value) = "SALARY" and trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

  • When I do it like this there are not errors in the expression window but the results are all errors

    =sum(Iif(trim(Fields!payrolcd.Value) = "SALARY" and trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

  • lcarrethers (9/20/2011)


    It tells me wrong number of arguments

    because the un-partnered brackets are confusing the number of arguments..

  • so how should it look

  • Ninja's_RGR'us (9/20/2011)


    =sum(Iif(trim(Fields!payrolcd.Value) = "SALARY" and trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

  • That is what i have and all the results are errors?

  • lcarrethers (9/20/2011)


    That is what i have and all the results are errors?

    Then it's a new error because it doesn't show any syntax error in my system.

  • In the column the results show

    #Error

  • In the output window you should have something a little more usefull (yes I know it's annoying!).

  • So your telling me

    =sum(Iif(trim(Fields!payrolcd.Value) = "SALARY" and trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

    should work?

    How do i trouble shoot that error

  • lcarrethers (9/20/2011)


    So your telling me

    =sum(Iif(trim(Fields!payrolcd.Value) = "SALARY" and trim(Fields!PAYRCORD.Value) = "SALARY", Fields!Untstopy.Value,0))

    should work?

    How do i trouble shoot that error

    In the OUTPUT window you'll have the real error. Can't do anything for you without that.

Viewing 15 posts - 1 through 15 (of 36 total)

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