Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to adding the Query for LIKE in Query builder and my code is like

SELECT name, surname, address, Account no FROM sheet1
WHERE name LIKE @name%


But its showing error.

Where the Query,
SELECT name, surname, address, Account no FROM sheet1
WHERE name = @name


Works successfully.

Please can you give me suggestions to run the LIKE function query through query builder.

My data in name column is like e.g. "Amit Chaoudhari"

If i search for "Ami" it should show the reach for "Amit Chaoudhari"


Thanks,

Mayur
Posted

1 solution

Mayur....U should Chmage the query as..
SQL
SELECT name, surname, address, Account no FROM sheet1
WHERE name LIKE @name+'%'



it works.....fine..
 
Share this answer
 
Comments
Mayur2258 27-Feb-12 2:38am    
Thanks a lot buddy....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900