Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access - Create Table with All Fields From Original Table

Posted on 2009-04-04
3
Medium Priority
?
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Assisted Solution

by:cmrobertson
cmrobertson earned 400 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 1600 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

618 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