Access 2000 - Query to eliminate quotes / template

  • Thread starter Thread starter Abay
  • Start date Start date
A

Abay

1. I am importing a text data file in access which has text fields enclosed
in double quotes e.g. "George Brown", I would like to create a query remove
the quotes.

2. I need to also import an Excel spread sheet & would like to set up a
template to assign the same field names to the excel data as I have in the
table to which the excel data will be appended, but can't see where I can do
that with excel data, like I can with non excel data i.e. a basic .txt file.

Any help with the above would be much appreciated.

Thanks in advance,

Abay
 
Abay said:
1. I am importing a text data file in access which has text fields
enclosed in double quotes e.g. "George Brown", I would like to create a
query remove the quotes.


How bout

UPDATE MyTable
SET MyField = Replace(MyField, Chr(34), "")

2. I need to also import an Excel spread sheet & would like to set up a
template to assign the same field names to the excel data as I have in the
table to which the excel data will be appended, but can't see where I can
do that with excel data, like I can with non excel data i.e. a basic .txt
file.

Dunno, sorry

HTH anyway;

Amy
 
Many thanks Amy for your reply .. I tried that, entered:

UPDATE LOGS SET Cname = Replace(Cname, Chr(34),"");

But get the error " Undefined function, "Replace" in expression ..

Abay
 
Ah, that's because Access 2000 (early versions at least) does not recognize the
replace function.

In a code module, you will need to create a simple function to do this.
Something like the following

Public Function MyReplace(strIn As String, strFind As String, _
strReplace As String, Optional lngstart As Long = 1, _
Optional lngcount As Long = -1, Optional lngCompare As Long = 1)

MyReplace = Replace(strIn, strFind, strReplace, lngstart, lngcount, lngCompare)
End Function
 
Back
Top