Switch statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to execute a switch statement that looks at the last 3 letters in
a trader's portfolio, [port]. Can I use a "like" in the statement? Also, I
want 2 portfolios to yield "DPM" (EMS and MOD), can I use an or statement?
How else can I get this to work?
Role: Switch[port] = Like*RM*, "RMM", [port] = EMS or MOD, "DPM", "FMM"

Thanks.
 
Switch([Port] Like "*RM?","RMM",[Port] Like "*EMS" or [Port] Like "*MOD",
"DPM, True,"FMM")

Try the above.
You need to
-- include strings within quote marks
-- have complete comparison operations
-- use True, SomeValue for an "else" result

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Thanks for the help.

John Spencer said:
Switch([Port] Like "*RM?","RMM",[Port] Like "*EMS" or [Port] Like "*MOD",
"DPM, True,"FMM")

Try the above.
You need to
-- include strings within quote marks
-- have complete comparison operations
-- use True, SomeValue for an "else" result

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

TraderAnalysis said:
I am trying to execute a switch statement that looks at the last 3 letters
in
a trader's portfolio, [port]. Can I use a "like" in the statement? Also,
I
want 2 portfolios to yield "DPM" (EMS and MOD), can I use an or statement?
How else can I get this to work?
Role: Switch[port] = Like*RM*, "RMM", [port] = EMS or MOD, "DPM", "FMM"

Thanks.
 
Back
Top