# How to use LIKE in AQL? **Category:** [AQL](https://discourse.openehr.org/c/aql/43) **Created:** 2020-12-04 16:24 UTC **Views:** 1500 **Replies:** 6 **URL:** https://discourse.openehr.org/t/how-to-use-like-in-aql/1147 --- ## Post #1 by @luiz_Minelli hello, I'm trying to use a LIKE in AQL, but it doesn't work ... how do I like to search for any place that has this certain date? How can I do it? ![Captura de Tela 2020-12-04 às 13.24.19|690x448](upload://o1DVr1P62hl5jBRjOcltsYpOyXa.png) --- ## Post #2 by @vanessap Hi @luiz_Minelli would something like this match your question? ![image|690x337](upload://vbeSIRz8l5lW1P6TiOfAxnGJl18.png) --- ## Post #3 by @luiz_Minelli So, I do like you and it doesn't work for me ... I wanted him to catch everyone without the timezone ![Captura de Tela 2020-12-04 às 14.20.06|690x368](upload://cqsodqCljRwl8XbrGLgmcodbYei.png) --- ## Post #4 by @luiz_Minelli Am I doing something wrong? --- ## Post #6 by @pablo LIKE is only available for String values, I suspect your path .../items[at0075]/value is a DV_DATE_TIME, not a String. To get the String representation, you need to add a /value to tour path. Remember operators apply to certain types. I guess the AQL editor is not doing type checking over the paths and operators, that is why you don't know what the error is. --- ## Post #7 by @mjaynixxz ![Selection_278|690x339](upload://v1z0t7KoGm10F8JQkVuj32JQQ7X.png) Hello, Good day, i am also having a similar situation here. I want to have a parameterised search where either a two or three letter input should return all name almost matching the search. How can this be achieved. Thank you --- ## Post #8 by @ian.mcnicoll On Better CDR you need to use * as the wildcard Partial matching with `LIKE` operator > Allows matching with wildcards `*` and `?`: > > * `*` stands for *any string*, > * `?` stands for *any character*. > > ``` > SELECT DISTINCT c/archetype_details/template_id/value as templateName > FROM EHR e > CONTAINS COMPOSITION c > WHERE templateName LIKE "Vital*" ``` ``` WHERE Patient_Name LIKE "McN*" * ``` so ``` WHERE Patient_Name LIKE :PatientMatch ``` and patientMatch = McN* (the paramterisation adds quotes AFAIK ``` I wonder if the paramaterisation is adding quotes which get in the way of properly formatting the Like. worth looking at the executed AQL that will appear in the response --- **Canonical:** https://discourse.openehr.org/t/how-to-use-like-in-aql/1147 **Original content:** https://discourse.openehr.org/t/how-to-use-like-in-aql/1147