Solved

Access - Create Table with All Fields From Original Table

Posted on 2009-04-04
3
209 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 119

Accepted Solution

by:
Rey Obrero 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now