1472
Views
5
Comments
Solved
Search filter by name and surname
Question

Hi guys, im trying to build a filter to search on an aggregate by name or surname!


My code is this but doesnt work 


SyntaxEditor Code Snippet

DirecaoProvedoria.NomeCliente like "%" + NomeCliente + "%" + NomeCliente 
2018-09-07 14-10-53
George Uzonj
Solution
DirecaoProvedoria.NomeCliente like "%" + NomeCliente + "%"

Hey,

Assuming you have only one Search Input where you store its value in the variable NomeCliente and you store the whole name in DirecaoProvedoria.NomeCliente, this should be enough.

UserImage.jpg
Dylan Heunis

Hi João,

To better assist you, could you please say what your table attributes are in 

DirecaoProvedoria 

and what do they mean? Also, what are your query string parameters and what do they mean?


Let's say your table looks like this:

User.name

User.surname


And your query string is called 'query'.


Then your filter could look like this:

User.name like "%" + query + "%" or User.surname like "%" + query + "%"

Otherwise, if your table is setup to include both first name and last name like this:


User.name

And your query string is either 'name' or surname'


Then your filter could look like this:

User.name like '%" + name + "%" or User.name like "%" + surname + "%"

2012-08-24 04-32-41
Juan Carlos Elorde
DirecaoProvedoria.NomeCliente like "%" + Firstname + "%" or
DirecaoProvedoria.NomeCliente like "%" + LastName + "%"

Is this the use case?

2018-09-07 14-10-53
George Uzonj
Solution
DirecaoProvedoria.NomeCliente like "%" + NomeCliente + "%"

Hey,

Assuming you have only one Search Input where you store its value in the variable NomeCliente and you store the whole name in DirecaoProvedoria.NomeCliente, this should be enough.

2022-03-09 07-24-55
BARKHA Pradhan

USE THIS  SYNTAX 

User.name like "%" + query + "%" and  User.surname like "%" + query + "%"

UserImage.jpg
sumita mishra

yes , its works for me

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.