Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switch command 1

Status
Not open for further replies.

JetRamsey

Technical User
Oct 22, 2010
49
US
I'm trying to figure out the best way to give a new name to a returning result. For example, I've tried the switch command like this:

= Switch( Fields!Disposition.value="Repaired","Completed", Fields!Disposition.value="NotRepaired","Not Completed", Fields!Disposition.value="MoveToNextLine","Not Completed")

This works, but since our database is not perfect, I need one extra line and could not find an example to show me.

What I need is an if then else statement. I've met the if then part of the statement above, but to finish it off, I need to say

else "UNKNOWN" which would be a catchall for fields entered incorrectly.

Any direction.

TIA
 
You could trick the switch function - something like

= Switch(
Fields!Disposition.value="Repaired","Completed",
Fields!Disposition.value="NotRepaired","Not Completed",
Fields!Disposition.value="MoveToNextLine","Not Completed"
True,"UNKNOWN")
)

 
Sorry - missed a comma;

= Switch(
Fields!Disposition.value="Repaired","Completed",
Fields!Disposition.value="NotRepaired","Not Completed",
Fields!Disposition.value="MoveToNextLine","Not Completed",
True,"UNKNOWN")
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top