Solved

Access - Create Table with All Fields From Original Table

Posted on 2009-04-04
3
239 Views
Last Modified: 2012-05-06
The following SQL Statement is effective in creating three new ID/Name Fields from one original field, and inserting into a new table C.

Unfortunately, it does not code to include all the other original fields from Table A into Table C. Please offer a modification to this code:

select Val([Provider]) as FieldID,Trim(Mid([Provider], InStr([Provider], "-") + 1, InStr([Provider], ",") - 1 - InStr([Provider], "-"))) as FieldLastName,Trim(Mid([Provider], InStr([Provider], ",") + 1, InStrRev([Provider], " ") - 1 - InStr([Provider], ",") + 1)) as FieldFirstName INTO C
From A

Thanks
0
Comment
Question by:tahirih
3 Comments
 
LVL 7

Assisted Solution

by:cmrobertson
cmrobertson earned 100 total points
ID: 24067621
you will simply need to add the additional fields to your list if you do not use the as option they will use the same field names in the new table is all.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 400 total points
ID: 24067668
just add an asterisk (*) and a comma ( , )


select *, Val([Provider]) as FieldID,Trim(Mid([Provider], InStr([Provider], "-") + 1, InStr([Provider], ",") - 1 - InStr([Provider], "-"))) as FieldLastName,Trim(Mid([Provider], InStr([Provider], ",") + 1, InStrRev([Provider], " ") - 1 - InStr([Provider], ",") + 1)) as FieldFirstName INTO C
From A
0
 

Author Closing Comment

by:tahirih
ID: 31566578
Thank you both! All the experts have been wonderful, and ithe solutiond assist me with my responsibilities immensely.
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question