Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Anyone see anything wrong with this:
if(mid(MntPlan_WARPL,1,5) = 'PMH/J',mid(MntPlan_WARPL,1,5),
if(mid(MntPlan_WARPL,1,5) = 'PMC/D',mid(MntPlan_WARPL,1,5),
if(mid(MntPlan_WARPL,1,3) = 'PMN',mid(MntPlan_WARPL,1,3),
if(mid(MntPlan_WARPL,1,3) = 'PML',mid(MntPlan_WARPL,1,3),
if(mid(MntPlan_WARPL,1,3) = 'PMA',mid(MntPlan_WARPL,1,3)))))) as PM_Type
Thanks
Looks fine to me syntax wise. What error you are facing?
No visible issue.
What is being returned?
Hi Thom.
Seems good to me. What are you trying to achieve and what are the errors you are facing here?
PMA only is being returned
It would be possible if you post a sample of your data?
Hi thom,
I'm thinking maybe this is what you are trying to achieve?
if(MID(MntPlan_WARPL, Index(MntPlan_WARPL,'PMH/J'), 5) = 'PMH/J','PMH/J',
if(MID(MntPlan_WARPL, Index(MntPlan_WARPL,'PMC/D'), 5) = 'PMC/D','PMC/D',
if(MID(MntPlan_WARPL, Index(MntPlan_WARPL,'PMN'), 3) = 'PMN','PMN',
if(MID(MntPlan_WARPL, Index(MntPlan_WARPL,'PML'), 3) = 'PML','PML',
if(MID(MntPlan_WARPL, Index(MntPlan_WARPL,'PMA'), 3) = 'PMA','PMA',))))) as PM_Type
Might be this
if(mid(MntPlan_WARPL,1,5) = "PMH/J",mid(MntPlan_WARPL,1,5),
if(mid(MntPlan_WARPL,1,5) = "PMC/D",mid(MntPlan_WARPL,1,5),
if(mid(MntPlan_WARPL,1,3) = "PMN",mid(MntPlan_WARPL,1,3),
if(mid(MntPlan_WARPL,1,3) = "PML",mid(MntPlan_WARPL,1,3),
if(mid(MntPlan_WARPL,1,3) = "PMA",mid(MntPlan_WARPL,1,3)))))) as PM_Type