Search by ASCII Codes

Hemish

Registered User.
Local time
Today, 23:05
Joined
Jan 20, 2005
Messages
65
Hi,

I import data through different files into a table, the data comes in different formats. I have a problem sometimes some records have double quotation marks and carriage returns. I know how to replace them as

Carriage Returns

Replace([FieldName],Chr(13) & Chr(10),""

Double Quotation Marks

Replace([FieldName],Chr(34),""

But if i want to use an iif statement because in the field there could be a Double Quotation Mark or Carriage return then it does not find the record

iif([FieldName] like Chr(34),Replace([FieldName],Chr(34),"",[FieldName])

Does anyone know a way how i would solve this?

Thanks
 
You just need to use something like.
Code:
Replace(Replace([FieldName], Chr(13) & Chr(10), ""), Chr(34), "")
Replace will only change the value if the search string is actually found, you do not have to use an IIF.
 
May I ask what exactly you're trying to achieve before we worry about ASCII characters? You want to be able to search with text containing single or double quotes or you want to replace the afore-mentioned in your table with some other character?
 

Users who are viewing this thread

Back
Top Bottom