Hi All,
Will be needing your help again, so far I have a SQL query that will paste all data from MS Access.
However, I dont want the excel to include the Primary Key Column.
Is there a way to do this?
Thanks!
Hi All,
Will be needing your help again, so far I have a SQL query that will paste all data from MS Access.
However, I dont want the excel to include the Primary Key Column.
Is there a way to do this?
Thanks!
Create a query in Access that outputs the fields you want, and then create a connection to that query from Excel.
Design everything to be as simple as possible, but no simpler.
Hi Thanks.
But im already done with that part.
What I'm asking is, is there a better way of writing this code?
sQL = "SELECT [Col1], [Col2], [Col3], [Col4], and so on until Col89 FROM myDB"
The above statement is working however it's pretty long for a code.
Col0 = my primary key in ms access.
I'm wondering if it is possbile to be like this.
sQL = "SELECT * FROM myDB WHERE (EXCLUDING Pimary Key Column)"
So that's what I'm actually asking.
Hmm no it's not really possible, and that's by design because you should explicitly state the columns you want to return. You only have to build the string once. Alternatively you could just hide or delete the primary key column in Excel.
In your SQL statement, if your PK is in the first column, then don't Select that column.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks