bill201
asked on
how to make a queyr to delete comma in a text field in access 2010
hi
i have a lot of text field that have comma like " or , and they are not in the same place in every field like that example:
green "
gr"een
"green
green,
and i want to make a query to delete every comma in the field how can i make it?
i have a lot of text field that have comma like " or , and they are not in the same place in every field like that example:
green "
gr"een
"green
green,
and i want to make a query to delete every comma in the field how can i make it?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you talking about a Comma or a Single quote ?
If single quote ... then
UPDATE Table1 SET
WHERE (((Table1.FIELD1)=Replace( [FIELD1], Chr(39) ,"")));
mx
If single quote ... then
UPDATE Table1 SET
WHERE (((Table1.FIELD1)=Replace(
mx
If double quote then
UPDATE Table1 SET
WHERE (((Table1.FIELD1)=Replace( [FIELD1], Chr(34) ,"")));
UPDATE Table1 SET
WHERE (((Table1.FIELD1)=Replace(
to include a where clause in the update query
" is not a comma
, is a comma
chr(34) is "
to delete them, use an update query
update table
set [field]=replace(replace([f ield],chr( 34),""),", ","")
where instr([field],chr(34))>0 or instr([Field],",")>0
" is not a comma
, is a comma
chr(34) is "
to delete them, use an update query
update table
set [field]=replace(replace([f
where instr([field],chr(34))>0 or instr([Field],",")>0
ASKER
is dont work me
i get a message that it's update but actually i don't see any update
i speak about this kind of characters:
commas and Quotation mark and Apostrophe
and i have at least two character in in every field
i get a message that it's update but actually i don't see any update
i speak about this kind of characters:
commas and Quotation mark and Apostrophe
and i have at least two character in in every field
what doesn't work...
try this
update table
set [field]=replace(replace(re place([fie ld],chr(34 ),""),",", ""),chr(39 ),"")
post the query you are using,
better upload a copy of the db
try this
update table
set [field]=replace(replace(re
post the query you are using,
better upload a copy of the db
ASKER
it's don't work so i'm uploading this database but i hope that you will can open it because it have hebrew characters
the name of this field is "subject"
calendar.zip
the name of this field is "subject"
calendar.zip
ok, can't get the correct ascii value of the character, you might be able to do so at your end
run this codes
look in the immediate window and copy and paste here what was printed
run this codes
Sub gChar()
Dim rs As DAO.Recordset, j As Integer, s As String
Set rs = CurrentDb.OpenRecordset("select top 1 subject from calendar where startdate='1/1/2011'")
s = rs(0)
Debug.Print s
For j = 1 To Len(s)
Debug.Print Asc(Mid(s, j, 1))
Next
rs.Close
End Sub
look in the immediate window and copy and paste here what was printed
ASKER
¿i get this numbers
216
228
32
225
232
225
250
32
250
249
242
216
224
216
228
32
225
232
225
250
32
250
249
242
216
224
ASKER
it's now in my time zone 4:00 am so i most to go sleep for a while (if not why wife will kill me :)
a big thanks for you and be in touch tomorrow
a big thanks for you and be in touch tomorrow
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also run this modify codes
copy and post back the result here
Sub gChar()
Dim rs As DAO.Recordset, j As Integer, s As String
Set rs = CurrentDb.OpenRecordset("select top 1 subject from calendar where startdate='1/1/2011'")
do until rs.eof
s = rs(0)
For j = 1 To Len(s)
Debug.Print Asc(Mid(s, j, 1))
Next
rs.movenext
debug.print "xxxxxxx"
loop
rs.Close
End Sub
copy and post back the result here
oops, use this codes
Sub gChar()
Dim rs As DAO.Recordset, j As Integer, s As String
Set rs = CurrentDb.OpenRecordset("select top 2 subject from calendar where startdate='1/1/2011'")
do until rs.eof
s = rs(0)
For j = 1 To Len(s)
Debug.Print Asc(Mid(s, j, 1))
Next
rs.movenext
debug.print "xxxxxxx"
loop
rs.Close
End Sub
ASKER
235
228
32
225
232
225
250
32
250
249
242
224
xxxxxxx
228
32
225
232
225
250
32
250
249
242
224
xxxxxxx
ASKER
235
228
32
225
232
225
250
32
250
249
242
224
xxxxxxx
244
248
249
250
32
229
224
248
224
xxxxxxx
228
32
225
232
225
250
32
250
249
242
224
xxxxxxx
244
248
249
250
32
229
224
248
224
xxxxxxx
see this link and try to find the dec value of the character
http://ascii-table.com/windows-codepage.php?1255
http://ascii-table.com/windows-codepage.php?1255
see this link too
http://www.ascii.ca/cp1255.htm
http://www.ascii-codes.com/cp862.html
try this query
update calendar
set [subject]=replace(replace( [subject], chr(148),""),chr(146),"")
http://www.ascii.ca/cp1255.htm
http://www.ascii-codes.com/cp862.html
try this query
update calendar
set [subject]=replace(replace(
ASKER
i suceed with making copy and paste this charcter ¿
and then i make like this
update calendar
set [subject]=replace(subject, "¿","")
thanks very very much
and then i make like this
update calendar
set [subject]=replace(subject,
thanks very very much
, is a comma
to delete them, use an update query
update table
set [field]=replace(replace([f
chr(34) is "