LIKE operator in Customer SQL?


can i use the LIKE operator in User Queries?

Thanks, Florian


Yes, it is possible. You can use ‘LIKE’ operator, but you need to use the field separator or the segment separator to write your query.
So, for example, you want to create an user query that will filter all invoice candidates that have invoice rule ‘After delivery’ (D)

The pure sql code, using LIKE operator will be: InvoiceRule LIKE 'D'
But if you write it like that, will not work, because will not know how to parse that sql.
The correct way is: <^>InvoiceRule<^> LIKE <^>D<^>
Notice that LIKE operator has a space before and after. This is important.
Also notice <^>. This is the field separator. You will use it to mark the search field, the operator and the value.
Also exists segment separator, which is this <~>, that is used when we have more terms.
For example, if you need to filter invoice candidates with invoice rule ‘After Delivery’(D) and for a certain partner, you need to write it like this:
AND<^>InvoiceRule<^> LIKE <^>D<^><~>AND<^>Bill_BPartner_ID<^>=<^>2156423<^>
Other important thing is the name of the column. It must be the exact name as it is in AD_Column.ColumnName.

Best regards,

1 Like

Hi Cristina

Thank you! Now it works :slight_smile:

Cheers, Flo

1 Like