Doing an expression I get an error, can someone show me the correct syntax here?
=IIf(Fields!t_cpcp.Value ="310", "Purchased Material & Raw Material", Nothing)
=IIf(Fields!t_cpcp.Value ="320", "Manufacturing Direct Labor", Nothing)
=IIf(Fields!t_cpcp.Value ="325", "Subcontract Cost", Nothing)
=IIf(Fields!t_cpcp.Value ="330", "Engineering Direct Labor", Nothing)
=IIf(Fields!t_cpcp.Value ="340", "Manufacturing Labor O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="345", "Engineering Labor O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="350", "Material O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="355", "Labor O/H Surcharge", Nothing)
=IIf(Fields!t_cpcp.Value ="360", "Subcontract Material Burden", Nothing)
=IIf(Fields!t_cpcp.Value ="MFD", "Manufactured Items", Nothing)
If you want this to all be in one expression, you may want to use the SWITCH statement:
=Switch(<condition>, <return value if true>, <next condition>, <return value if true>, ...)
The switch statement will return the value for the first condition that is true.Using your example, you could try:
=Switch(Fields!t_cpcp.Value ="310", "Purchased Material & Raw Material",
Fields!t_cpcp.Value ="320", "Manufacturing Direct Labor",
Fields!t_cpcp.Value ="325", "Subcontract Cost",
...rest of them go here...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With