G
Guest
I've got an Access app that links to several user-created spreadsheets and does SQL summation, etc. Because of the nature of this appication (and the fact that my user's don't have any standards!), the names of the columns themselves can vary. Their absolute position does not change. So for instance, the first column in the linked sheet might be called [PERCENT GOAL] for one person, [PCT GOAL] for another person, and [% GOAL] for still another.
I can safely assume that regardless of what it's called, that first column is going to contain the value that I want. I've actually written a VBA function that, if given a table name and a column position, will return the column name. I use it to dynamically build SQL statements, and from a purely functional standpoint, it works. However, it's damn slow in running
Is there something native in SQL that I can put in a select statement that would represent "The First Column" or "The Seventh Column", regardless of what the columns are named?
I can safely assume that regardless of what it's called, that first column is going to contain the value that I want. I've actually written a VBA function that, if given a table name and a column position, will return the column name. I use it to dynamically build SQL statements, and from a purely functional standpoint, it works. However, it's damn slow in running
Is there something native in SQL that I can put in a select statement that would represent "The First Column" or "The Seventh Column", regardless of what the columns are named?