Has anyone successfully gotten Skip Condition If Empty to work for BAQ parameters in Kinetic?
I’m working on a customer name lookup BAQ, where I:
- First check for an exact match on
@IDP_FullName
. - Only if that fails, perform a LIKE search using
@IDP_FirstName
and@IDP_LastName
.
However, when I run the query with @IDP_FirstName
and @IDP_LastName
empty, I get a “Bad SQL statement” error instead of the condition being skipped.
I have Skip Condition If Empty checked for @IDP_FirstName
and @IDP_LastName
(see screenshot), but it doesn’t seem to work as expected.
Where clause from BAQ:
from Erp.CustCnt as [CustCnt]
where ((CustCnt.Company = @CompanyID
and CustCnt.ShipToNum = ‘’ )
and (CustCnt.Name = @IDP_FullName
or CustCnt.Name LIKE ‘%’ + @IDP_FirstName + ‘%’ + @IDP_LastName + ‘%’ ))