Solved

Insert Statement

Posted on 2015-01-07
10
168 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 119

Expert Comment

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

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 119

Expert Comment

by:Rey Obrero
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 119

Accepted Solution

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

896 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

12 Experts available now in Live!

Get 1:1 Help Now