Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Search String Replace Error

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-08 : 12:04:13
parikshit writes "I am using SQL Database search for selecting records based on the search string...But when I enter JOHN AND PETER(as a example search criteria) the sql query fails and generates an error. Can you please help me in this ?Its very very urgent.I am also using REPLACE function to replace the blank spaces..Is there any way I resolve this problem..
searchstr=replace(searchstr," "," AND ",1,-1,1) This is what I used in my replace function to replace the blank spaces. But when i enter a search criteria as mentioned above i.e JOHN AND PETER as search criteria the search string gets replaced as john AND and AND peter.. How to overcome this problem? Expecting help at earliest..Thanks in advance to everyone.


Regards

Parikshit"

X002548
Not Just a Number

15586 Posts

Posted - 2004-07-08 : 12:29:50
It would be alot easier to help if you posted the code

Also are you using LIKE 'JOHN AND PETER%'?



Brett

8-)
Go to Top of Page
   

- Advertisement -