Import from excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recently copied and pasted some data from the Web into Excel. I then imported that data into an Access table. However when looking at the imported data I noticed that about 80% of the fields have a blank space as the first character in the field. How can I delete these blank spaces.
 
Richard Elliott said:
I recently copied and pasted some data from the Web into Excel. I then
imported that data into an Access table. However when looking at the
imported data I noticed that about 80% of the fields have a blank space as
the first character in the field. How can I delete these blank spaces.

You should be able to search and replace from the table.
If that fails or you will continue to do it, export the table to a text
file, then import into Access. This will allow you to control where a field
starts.
 
You can quickly remove the spaces with an update query and the trim function. The trim function removes both leading and trailing spaces. You could also use the rtrim function which just removes leading spaces. If you are using the query designer, set the query type to be an update query. Select the field with the leading spaces. In the "update to" section", put something like this:
Trim([mytextfield])
- mytextfield is the name of the field\column that you are updating.

Scott Shearer, MCSD, MCDBA
msshearer@ @ @ hotmail.com


----- Richard Elliott wrote: -----

I recently copied and pasted some data from the Web into Excel. I then imported that data into an Access table. However when looking at the imported data I noticed that about 80% of the fields have a blank space as the first character in the field. How can I delete these blank spaces.
 
The rtrim function removes the trailing spaces. The ltrim function removes the leading spaces. This is mis-stated in my previous post

Scott Shearer, MCSD, MCDBA
 
Back
Top