Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace in WHERE Clause

Status
Not open for further replies.

jambai

Programmer
Mar 21, 2007
58
US
I am using MS Access 2002 and the replace is working fine in the below query
SELECT * FROM dbo_Facility WHERE [NAME] Like Replace('jambai',',','')));

I am wondering ist possible to create the below query.
Please see the marked code, this was the one I referred as left side of the where clause
SELECT * FROM dbo_Facility WHERE (REPLACE([NAME],',','') LIKE 'jambai%'

Thanks
Kumar
 
Have you tried
Code:
SELECT * FROM dbo_Facility WHERE (REPLACE([NAME],',','') LIKE 'jambai[b]*[/b]'
i.e. using * rather than %

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Yes I did,

and I tried the below too

SELECT * FROM dbo_Facility WHERE (REPLACE([NAME],",","") LIKE 'jambai*'

Thanks
Kumar
 
Unbalanced parentheses, I guess.
You may try this (JetSQL syntax):
SELECT * FROM dbo_Facility WHERE Replace([NAME],',','') Like 'jambai*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV,

But the parentheses are well in place. I tried with your Query too.

Data type mismatch in criteria expression was the error I got when I run these kind of queries

Thanks
 
And this ?
SELECT * FROM dbo_Facility
WHERE (Replace([NAME] & '',',','') & '') Like 'jambai*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,

I forgot to tell you that the table is a linked table from SQL Server.

Thanks
 
Thanks PHV.

It works.

Thank you so much

Jambai
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top