pdvsa
asked on
Switch
Experts: it says I have a syn tax in this Swtich:
(it could be towards the end with the True part.
MyBusUnit: ([Activity Code] Like "DH*","Onshore Houston",[Activity Code] Like "LA*","Onshore Claremont",[Activity Code] Like "GS *","Subsea",[Activity Code] Like "ES *","Engineering Offshore",[Activity Code] Like "KT*","KTI",[Acivity Code] Like "MS *","Overhead Charges",[Activity Code] Like "TFP *","Offshore Fixed Platform",[Activity Code] Like "*TOF *","Offshore Finland",[Activity Code] Like "MX *","Onshore Mexico",[Activity Code] Like "DI *","What is DI???",True,"")
(it could be towards the end with the True part.
MyBusUnit: ([Activity Code] Like "DH*","Onshore Houston",[Activity Code] Like "LA*","Onshore Claremont",[Activity Code] Like "GS *","Subsea",[Activity Code] Like "ES *","Engineering Offshore",[Activity Code] Like "KT*","KTI",[Acivity Code] Like "MS *","Overhead Charges",[Activity Code] Like "TFP *","Offshore Fixed Platform",[Activity Code] Like "*TOF *","Offshore Finland",[Activity Code] Like "MX *","Onshore Mexico",[Activity Code] Like "DI *","What is DI???",True,"")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, please not that I am not associated with Offshore Mexico :-)
I did drop off your last condition, which I put back in Bold below ... wasn't sure you really wanted that.
MyBusUnit: Switch([Activity Code] Like "DH*", "Onshore Houston", [Activity Code] Like "LA*", "Onshore Claremont", [Activity Code] Like "GS *", "Subsea", [Activity Code] Like "ES *", "Engineering Offshore", [Activity Code] Like "KT*", "KTI", [Acivity Code] Like "MS *", "Overhead Charges", [Activity Code] Like "TFP *", "Offshore Fixed Platform", [Activity Code] Like "*TOF *", "Offshore Finland", [Activity Code] Like "MX *", "Onshore Mexico", [Activity Code] Like "DI *", "What is DI???" ,True,"")
I did drop off your last condition, which I put back in Bold below ... wasn't sure you really wanted that.
MyBusUnit: Switch([Activity Code] Like "DH*", "Onshore Houston", [Activity Code] Like "LA*", "Onshore Claremont", [Activity Code] Like "GS *", "Subsea", [Activity Code] Like "ES *", "Engineering Offshore", [Activity Code] Like "KT*", "KTI", [Acivity Code] Like "MS *", "Overhead Charges", [Activity Code] Like "TFP *", "Offshore Fixed Platform", [Activity Code] Like "*TOF *", "Offshore Finland", [Activity Code] Like "MX *", "Onshore Mexico", [Activity Code] Like "DI *", "What is DI???" ,True,"")
MX,
Having a final pairing of:
is basically enabling a return value for "none of the above". It would be equivalent to excluding it, but then wrapping the Switch expression in Nz. I explain its usage here:
https://www.experts-exchange.com/Microsoft/Development/MS_Access/A_3556-Using-the-Switch-Function-in-Microsoft-Access.html
Patrick
Having a final pairing of:
MyField: Switch(..., True, "Something")
is basically enabling a return value for "none of the above". It would be equivalent to excluding it, but then wrapping the Switch expression in Nz. I explain its usage here:
https://www.experts-exchange.com/Microsoft/Development/MS_Access/A_3556-Using-the-Switch-Function-in-Microsoft-Access.html
Patrick
Yes ... I know that :-)
same as 1-1, <SomeDefaultValue>
mx
same as 1-1, <SomeDefaultValue>
mx
Think you mean 1 = 1
:)
:)
Yep ... NOT enough coffee yet ... and working on songs for a gig tomorrow night!
Be sure to post on Facebook how the show goes. I for one am interested :)
s/b packed ... but sadly, due to politics and club owner bs, this will apparently be the last show, as well as the weekly sunday night pro jam :-(
mx
mx
ASKER
I did forget the word SWITCH. I copied it from a formula I had in word and I forgot to include it.
I did mispell Activity also.
I did mispell Activity also.
mx