July 30, 2002 at 9:41 pm
hi,
izit that 2 replace functions cannot used at one textfield???
CompanyNameTF = trim(request.form("CompanyNameTF"))
CompanyNameTF = replace(request.form("CompanyNameTF"), "&", "And")
CompanyNameTF = trim(request.form("CompanyNameTF"))
CompanyNameTF = replace(request.form("CompanyNameTF"), "'", "''")
it only work for single quote then for the '&' it is not replaced...
pls giv some advice....thank you..
=)
July 31, 2002 at 1:50 am
Hi,
I assume that you are using the VBScript Replace function...that works fine on my system here...there's no problem replacing the "&" by "AND"...or is there something I am missing out here??
July 31, 2002 at 1:53 am
hi
if i did not put the replace for single quote, the replace for & can work but when two replace functions put together, then onli replace for single quote work so i m tinking how to make both work...
pls give me some advice... thanx =)
July 31, 2002 at 2:45 am
I think I get it now...
CTF = Request.form("CompanyNameTF")
CTF = Replace(Replace(CTF,"&","AND"),"'","''")
I hope this is what you are looking for.....
August 1, 2002 at 1:34 am
hi
i can replace the '&' to 'And' and also for the single quote to 2 single quotes function
the code below is a pulldown menu that capture those company name inside. for those company name which need to use replace function would aso be in the pulldown menu but when u selected the company name that used replace single quote to 2 single quote function it will say no record found.
While NOT rsQuery.EOF
If rsQuery("Company_Name") <> "" Then
response.write "<option "
If CompanyName <> "" Then
If trim(CompanyName) = trim(rsQuery("Company_Name")) Then
response.write "SELECTED "
End If
End If response.write "value='"
response.write trim(rsQuery("Company_Name"))
response.write "'>"
response.write trim(rsQuery("Company_Name"))
response.write "</option>"
End If
rsQuery.MoveNext()
Wend
rsQuery.close()
Set rsQuery = Nothing
pls give me some advice ... thank alot =)
Edited by - heero on 08/01/2002 03:30:48 AM
October 10, 2006 at 10:25 am
I hope you found the answer long ago to this question. I'm having the same problem.
OK - This is fixed. It was the presentation layer pagination cuttin off records.
Ignore the rest of this post!
This SQL worked in Query Analyzer:
(REPLACE(c.last_nm, ' ', '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(39), '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(39)+CHAR(32), '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(32)+CHAR(39), '') like 'Obrien'
OR REPLACE(c.last_nm, '-', '') like 'Obrien'
OR c.last_nm like 'Obrien')
order by prsn_ID
But it does not work in Forte. This is a stub where clause from DBGetaoBEPrsnByOrgIdNDtNBVEmplyPrsn
OR REPLACE(c.last_nm, CHAR(39), '') like :TempText
OR REPLACE(c.last_nm, CHAR(39)+CHAR(32), '') like :TempText
OR REPLACE(c.last_nm, CHAR(32)+CHAR(39), '') like :TempText
OR REPLACE(c.last_nm, '-', '') like :TempText
OR c.last_nm like :TempText)
declare @P1 intset @P1=180150022
declare @P2 int
set @P2=8
declare @P3 int
set @P3=1
declare @P4 int
set @P4=2
exec sp_cursorexecute 11, @P1 output, @P2 output, @P3 output, @P4 output, 48, '2006/10/06', '2006/10/06', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'O''BRIEN', 48, '2006/10/06', '2006/10/06', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'obrien%', 'O''BRIEN', 'O''BRIEN', 'JAMES'
select @P1, @P2, @P3, @P4
SELEct prsn_id,last_nm from be_prsn c where(REPLACE(c.last_nm, ' ', '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(39), '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(39)+CHAR(32), '') like 'Obrien'
OR REPLACE(c.last_nm, CHAR(32)+CHAR(39), '') like 'Obrien'
OR REPLACE(c.last_nm, '-', '') like 'Obrien'
OR c.last_nm like 'Obrien')
order by prsn_ID
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy