tags:

views:

32

answers:

2

In SQL

declare @keyword varchar(100)
declare @val varchar(100)
set @keyword =  '%asp.net%'
set @val = '%c#%'
select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like + @keyword + ) AND (f_Resume like + @val +) 
--select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like '%asp.net%' ) AND (f_Resume like '%c#.net%')

The last commented query is working da but the pevious query s not working can u help me in solving this.

+1  A: 

It's because you're treating your select statement as a string, while it's not. The following should work:

declare @keyword varchar(100)
declare @val varchar(100)
set @keyword =  '%asp.net%'
set @val = '%c#%'
select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like @keyword ) AND (f_Resume like @val) 
Prutswonder
A: 
select f_Resume_uid, f_Resume_Title, f_Resume, f_Filename 
from tbl_resume 
where f_Resume like @keyword and f_Resume like @val  
RedFilter