Import from excel

  • Thread starter Richard Elliott
  • Start date
R

Richard Elliott

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.
 
M

Mike Painter

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.
 
S

Scott Shearer

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.
 
S

Scott Shearer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top