IIF and wild cards (1 Viewer)

J_oggy07

New member
Local time
Today, 16:14
Joined
Apr 18, 2023
Messages
14
I have some material ciodes that ends in Z5 an in a calculated field I wish to add a surcharge, here is my stab at it.

IIf([MaterialGrade] Like "*Z5",([PriceofRM])*1.1,[PriceofRM])

I can not understand why it does not work when true

Thanks again for all your help, this is a great Forum

John.
 
Are you sure it's true? There any extra spaces or unseeable characters at the end of Material Code?

'ABCDEFGHIJKZ5 ' would evaluate to false because it doesn't end in Z5, it ends in Z5space.

Further, any NULL value in PriceOfRM would make it appear to 'not work' as well. Find one case where it fails and evaulate that case to determine why.
 
IIf(Right([MaterialGrade],2) = "Z5",([PriceofRM])*1.1,[PriceofRM])

PS, mushing multiple pieces of data into a single attribute violates first normal form.. the indicator for a surcharge should be a separate attribute rather than a part of some other attribute.
 

Users who are viewing this thread

Back
Top Bottom