Properly Setting Up Criteria For BAQ

Hello Epicor community!

Having some issues with the criteria of a BAQ. I’m trying to create a more robust customer search feature for Customers, and I want the BAQ to have 3 criteria.

The first is one that is a yes/no that is IncludeInactiveCustomers, if you select it, it includes active and inactive. If it is unchecked, it only pulls active.

The second is a search bar that uses a contains or matches, or some function that allows us to search by customerID

The third is the same as the second, but for customer name.

I have included below a picture of an example of the criteria, and this works when it’s the only criteria, but when I add the second, which is a copy of this for customername, it stops working. SQL error but Syntax is okay.

Thanks!

image

Change it from “CONTAINS” to “LIKE”. I always have issues with “Contains” but “LIKE” usually works for me.

Might be better to show the query phase in the thread so that we can see all three situations.

Also, you can set up the parameter so that the field is ignored when blank. Based on how I read your question I would do that as well.

Using contains you should not need the % as the function already is going to do work to find your string in the field.

CONTAINS is for full-index searches, use LIKE as suggested

CONTAINS is a predicate used in the WHERE clause of a Transact-SQL SELECT statement to perform SQL Server full-text search on full-text indexed columns containing character-based data types.

Hello All,

Thank you for the responses! I have tried the LIKE function, but to no avail.

This is what my criteria looks like, both parameters have the Skip Condition if Empty clause checked, but when I run it with some information entered in one of the parameters, it doesn’t give me the information. The same goes if i put accurate information in both parameters

But instead of a SQL error, it says no records returned

You need to add % like you did on your first screen shot.

You still need the wildcard % like you have in the original “CONTAINS” statement you showed.

Is there an echo in here? :rofl:

broad city lol GIF

lol I saw it right after I replied.

I do it all the time. Just joshing ya.

Brandon Scott Jones Agree GIF by CBS

Did you get this to work? If so, can you share your results. If not, I may have something that does.