Link to table

MetLife

Active Member
Joined
Jul 2, 2012
Messages
311
Office Version
  1. 365
Hi,

I want to link to a table which is contained in a .csv file, but the problem is that the first 3 rows are bad data I want to skip.

How do I do this automatically?

Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
You can't skip the data.
You can remove it from the csv file. Another possibility would be to create a query that ignores that data (assuming by "bad data" you mean data you don't want to see, and not data that is so bad that it makes the link no good).
 
Upvote 0
You are saying that I can't create sql code that just says "skip to line 3" prior to linking to the table??

Isn't this easy to do
 
Upvote 0
Isn't this easy to do
If you do not know how to do it, why would you think it would be easy?
Xenou's suggestions are the two best options I can think of also.

You are saying that I can't create sql code that just says "skip to line 3" prior to linking to the table??
How can you apply SQL code "prior to linking the table"? There is no SQL code in a Table link.

Link the table, then apply the SQL code AFTERWARDS (which is what creating a query to ignore the bad data actually does).
This should do what you want (just not necessarily in the order you thought it should happen).
 
Upvote 0
I don't know anything about sql, how do I create a query that skips the first 2 lines?

Given that the table is already linked.
 
Last edited:
Upvote 0
You use Criteria, based on what your data looks like.
Let's say that you have some field, let's call it "Field1", that is populated for all rows of data, but is blank for the lines we want to remove.
Then we just create a new query from our linked table, and on the Criteria row under this "Field1" field, we enter:
Code:
Not Is Null
 
Upvote 0
I'm a fan of importing data rather than linking to things like text files or Excel files. You have a lot more control of data when it is "in" Access - particular, control over data types and data validation.

If you need more help, give example of what the problem is (the bad data, vs. what good data looks like).
 
Upvote 0

Forum statistics

Threads
1,221,700
Messages
6,161,371
Members
451,700
Latest member
Eccymarge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top