473,473 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

insert into

I have created this query:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni;
I want that only the current record is appended in the table
iscrizioni2

thanks
by
Jan 18 '08 #1
2 1248
"nicolacantalupo" <ni*************@libero.itwrote
>I have created this query:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni;
I want that only the current record is appended in the table
iscrizioni2
What "current record"?

If from a Form, you should be able to obtain from the Form or the Form's
RecordSource the unique identifer of the Form's current record, and use it
to construct a WHERE or HAVING clause in your SQL.

Larry Linson
Microsoft Access MVP
Jan 18 '08 #2
On Fri, 18 Jan 2008 19:53:14 GMT, "Larry Linson"
<bo*****@localhost.notwrote:

Larry is right. A SQL statement like:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni
WHERE <primarykey= Forms!YourFormName!YourPrimaryKeyField

will update just a single row.
The HAVING clause is reserved for GROUP BY situations - not your
problem at this time.

-Tom.
>"nicolacantalupo" <ni*************@libero.itwrote
>>I have created this query:
INSERT INTO versamenti2 ( codice_iscrizione, riferimento )
SELECT codice_iscrizione, rif
FROM iscrizioni;
I want that only the current record is appended in the table
iscrizioni2

What "current record"?

If from a Form, you should be able to obtain from the Form or the Form's
RecordSource the unique identifer of the Form's current record, and use it
to construct a WHERE or HAVING clause in your SQL.

Larry Linson
Microsoft Access MVP
Jan 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
3
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
6
by: lenygold via DBMonster.com | last post by:
Hi everybody: What is the best way to I have 10 tables with similar INSERT requiremnts. INSERT INTO ACSB.VAATAFAE WITH AA(AA_TIN, AA_FILE_SOURCE_CD, .AA_TIN_TYP) AS ( SELECT AA_TIN,...
24
by: Henry J. | last post by:
My app needs to insert thousand value rows into a mostly empty table (data are read from a file). I can either use inserts, or use merge. The advantage of using merge is that in the few cases...
1
by: Mike1961 | last post by:
Hi all. I have problem with this asp code: strSplitDati = Split(request.Form("dati"), ",") for i = LBound(strSplitDati) to (INT(UBound(strSplitDati)/4)-1)*4 step 4 ...
1
by: EJO | last post by:
with sql 2000 enterprise Trying to build a stored procedure that will take the rows of a parent table, insert them into another table as well as the rows from a child table to insert into...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.