BAQ Expression help (LIKE function)

Dan - Is there no “start” and “end” (like the ^ and $ in RegEx)? If there were, you could eliminate the check for length.

As long as you don’t put % in front of it, it’s looking at the start. Same with the end.

So in the Statement

PartCost.PartNum like '[a-zA-Z][a-zA-Z]-[0-9][0-9][0-9][0-9]' and LEN(PartCost.PartNum) = 7

the and LEN(PartCost.PartNum) = 7 is superfluous ?

So PartCost.PartNum like '[a-zA-Z][a-zA-Z]-[0-9][0-9][0-9][0-9]' evaluates as true for AB-1234, but false for ab-12345 ??

1 Like

This is a calculated field in the baq.

case when (Part.PartNum like '[0-9][0-9][0-9][-][0-9][0-9][0-9]') then 1 else 0 end

this is getting hard for me to debug as our partnum are different

this works so I would think you would want
case when (Part.PartNum like '[a-zA-Z][a-zA-Z][-][0-9][0-9][0-9][0-9]') then 1 else 0 end

Add the brackets around the - to be [-]

Mark had this all along.

1 Like