search filter Assignment

  

Hi, guys!

I try to make search function filter in assignment test.

filter for booking status already work.

but filter for by first and last name still isn't work.

I using this code for filter by first and last name guest. anyone have better suggestion?

SyntaxEditor Code Snippet

Booking.GuestFirstName like "%" + GuestSearch + "%" and Booking.GuestLastName like "%" + GuestSearch + "%"

Thanks for response before.

Solution

Hello Ikshan,

Your filter criteria is using an "and" operator to perform search which would be interpreted as "fetch all guests with first name and last name both matching the search string". This would return result only if there are any records with First and Last name both matching your search string. To get records where either First name or Last Name matches your search string, you should be using an "or" operator instead.

Thanks

Solution