Part numbers have a prefix and a suffix. For example: ASO-40001. I’ve created two calculated fields so I have have a column for prefixes and a column for suffixes, as well as a column for the entire part number.
My calculation to create the suffix works great: SUBSTRING(PART.PARTNUM,5,5)
But I discovered a few parts that are ‘tests’ that I don’t want to appear on my query. Those suffixes are: “Part” or “99999” or “54322”.
I tried various things I found online to no avail. I bet this is really easy, but I’m stumped. I appreciate any assistance.
Hi @CSmith thank you so much for responding!
WHERE … NOT SUBSTRING(PARTNUM,5,5) IN (‘PART’,‘99999’,‘54322’)
Still getting syntax error: Incorrect syntax near the keyword ‘WHERE’.
I also tried…
WHERE…NOT SUBSTRING(PARTNUM,5,5) IN (‘PART’,‘99999’,‘54322’)
WHERE NOT SUBSTRING(PARTNUM,5,5) IN (‘PART’,‘99999’,‘54322’)
Ummm add a coondition to the SubQuery criteria…
Your condition is against the calc field suffix so
Click the NOT box
Table: Calculated
Field: Suffix (guessing here)
Operation: IN
Filter Value: Constant List → ‘99999’ Click New top right → ‘54322’
Or LIKE '_____-%' (5 underscores) to ensure it has five characters before the hyphen?
Doing it @julian-exile’s way only does the string evaluation one time per row and one bit comparison, instead of two substrings and one string compare… (probably doesn’t make much difference)
@Yodelayheewho (OPs) condition was the suffix not be either of 2 values.
I provided the generic way to specify exclusions to the final dataset returned from the subquery. Upon them not understanding my response I gave them a step by step how to click in the BAQ editor (10)… AFAIK, neither of your suggestions would provide the appropriate datasets the OP desires, but both are good examples of a possible solution to problems not relevant to the OPs initial post. Thanks for sharing!