Z
ZippyV
Hello everybody,
I need to create a query that (after it asked for the parameter "Insert
year") selects the right records from the original table, inserts them into
the archive table and deletes those records from the original table. My
problem is Access doesn't want to save the query because it got 2 statements
(Insert and Delete). Can I split this query into multiples without asking
twice for the 'Year' parameter?
So far I got this:
PARAMETERS [Which year?] Short;
INSERT INTO tblArchive(albumID, date)
SELECT albumID, date
FROM tblOriginal
WHERE ((tblOriginal.date)=Year([Which year?]));
DELETE FROM tblOriginal
WHERE ((tblOriginal.date)=Year([Which year?]));
I need to create a query that (after it asked for the parameter "Insert
year") selects the right records from the original table, inserts them into
the archive table and deletes those records from the original table. My
problem is Access doesn't want to save the query because it got 2 statements
(Insert and Delete). Can I split this query into multiples without asking
twice for the 'Year' parameter?
So far I got this:
PARAMETERS [Which year?] Short;
INSERT INTO tblArchive(albumID, date)
SELECT albumID, date
FROM tblOriginal
WHERE ((tblOriginal.date)=Year([Which year?]));
DELETE FROM tblOriginal
WHERE ((tblOriginal.date)=Year([Which year?]));