how to move errant data from one field to another

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

Guest

I have imported a CSV file into a an Access table, but somehow the CSV must
have had too many commas on some records because extra fields were created.
For about 20% of the records (total over 8000), the data for a certain field
is showing up in a bogus field. How can I move those pieces of data from the
bogus field back to the correct field?

Obviously, if the extra commas had been consistent this would be easy and I
could just rename the field, but as I said, it's only about 20%. It seems I
need to set up a query that determines if data is in the bogus field, and if
so, then move it into the correct field.
 
Hi,


A possible solution:

Append the data into a temp table and if an error is detected, point the row
and let the end user make the required modifications, in Excel, and
resubmit. If no error is detected, append the data from the temp table to
your "permanent" table.

Note that you have to drop the temp table in each case.


Hoping it may help,
Vanderghast, Access MVP
 
An update query can help.

e.g.
Update Tablename Set Field1 = Field2 WHERE ...

The problem will be discern what should be in the WHERE.
 
It could be as simple as

UPDATE YourTable
SET GoodField = BogusField
WHERE GoodField is Null and BogusField is Not Null
 
Back
Top