×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Selecting data from MS Access table columns based on column location instead of column names

Selecting data from MS Access table columns based on column location instead of column names

Selecting data from MS Access table columns based on column location instead of column names

(OP)
Let us I have a table name "Patient" in MS Access database and the table has following columns.

Member_ID (First Column)
Member_Name (Second Column)
Member_DOB (Third Column)
Member_Address (Fourth Column)
Member Zip (Fifth Column)

I would like to select the columns based on the column location/number/sequence than the column name.

What is the syntax in SQL to locate the column location?

Thanks for your help.
Ram

RE: Selecting data from MS Access table columns based on column location instead of column names

(OP)
We have health plan data file that need to be imported in to MS Access table. The column header names keeping changing or not constant/fixed
but the column location/sequence/order is fixed. So, instead of selecting/reading the columns by column names/header names, I would like
to read the columns by column number/column locations and import it into exsiting table or drop existing table & create new table.

Please see the attachment for example.




RE: Selecting data from MS Access table columns based on column location instead of column names

I don't believe there is any way to do this with pure Access SQL. I expect you would need to write a bit of DAO code to create a query.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Selecting data from MS Access table columns based on column location instead of column names

How do you do it now?
Do you have an MS Query that connects to Excel like:

SELECT Member_ID, Member_Name, Member_DOB, Member_Address, Member Zip
FROM Sheet1


And that's why you need to know the names of the columns in Excel?


---- Andy

There is a great need for a sarcasm font.

RE: Selecting data from MS Access table columns based on column location instead of column names

Hi,

What’s the reason for such a requirement?

That might help us help you.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Selecting data from MS Access table columns based on column location instead of column names

Can you do some preprocessing: open excel file with vba automation, rename headers (if you are sure that required data has headers and the order is fixed), save file and import data?

combo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close