Skip to Content

SQL problem when using <%AND(filtername,column_name like ?)%>

Hello Experts

I am trying to create a query that has optional Filters using the Filter <%AND(filtername,column_name like ?)%> token.

i want for my query to return everything if the user does not specify anything in the filter.

when i use this token nothing is returned by my query.

does anybody know how to use this token <%AND(filtername,column_name like ?)%> for optional filters.

your help will be greatly appreciated.

kind regards,

Thabiso Kamanga

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 18, 2011 at 10:33 PM

    Hi Thabiso,

    For optional filters you could use the AND_OP token. So for example, if the filter prompt is for filtering using the document display name, the syntax would be


    Note, the second occurrence of T1.DISPLAY_NAME is the name of the filter parameter defined on the Filter Prompts tab.

    You can set a default value for the filter by entering the value in the Default Value field of the filter prompt. If you intend to use a wildcard as the default value, you need to take into consideration the volume. If the query returns a large result it might not be a good idea to use the wildcard as the default value.

    The help section provides more information of the usage of the AND_OP token that you might find useful.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.