Solved

Insert Statement

Posted on 2015-01-07
10
169 Views
Last Modified: 2015-01-07
Hello,

Will a INSERT statement work for taking a record from one table to another?
0
Comment
Question by:Jass Saini
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 40536059
Yes, can you be a little more specific in what you are trying to accomplish.

ET
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40536061
yes

Insert into tablex(f1,f2)
select f1,f2 from tableY
0
 
LVL 18

Expert Comment

by:Simon
ID: 40536069
Insert into tbl1 (txtCol)
select txtAnotherCol from tbl2
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Jass Saini
ID: 40536082
Would it be okay to insert from one table to another when the col are different or do they have to be the same.  Where in the property should the action happen?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40536114
the names of columns may not be the same, BUT the number of columns must be the Same and the Data types must be the same.
0
 
LVL 18

Assisted Solution

by:Simon
Simon earned 250 total points
ID: 40536115
The order of the values clause and the select clause are what matters

insert into t1 (col3,col1)
select col2,col4 from t2

In this case col2 gets inserted in col3 of the table t1 and col4 gets inserted into col1 of t1.

Datatypes should be the same or coercible (e.g. numeric to string, but not alphanumeric string to numeric);.
0
 

Author Comment

by:Jass Saini
ID: 40536149
So should I use a COPY button to to copy that over...also...sorry forget this ..

Some of my fields that I need to copy are on the main form and others are the sub form.  Will that be okay?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 40536210
omg,,, @JAss SAini
please stick to the original problem that you posted..
when you got a solution, close the thread AND OPEN a new question for another problem.
0
 

Author Comment

by:Jass Saini
ID: 40536223
OK Thank you Rey...it is still part of the same problem.
0
 

Author Closing Comment

by:Jass Saini
ID: 40536224
Thank you
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

770 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