Query to import duplicate data based on dates

JackV11

New member
Local time
Today, 11:52
Joined
Jun 7, 2024
Messages
2
Hi All,

I'm a bit of a noob on the Access of things.
I'm trying to build a query that will import each month's data.
The data will be repeated but will have a new date.
Table: date_cap, team, acc_no, street, st_no, action, comments, Totals, 1st,2nd,3rd, success

The import from CSV to a temp table for each month is successful, but my amendment to the master table is the issue.
I want to import all months' data into a master table.
I created the first query and imported the first temp table successfully into the master table.
The second and other months are the issue.
query1.png

What am I missing here?

INSERT INTO tblMaster ( DateCap, TEAM, METER_NR, KRN, STREET, AREA, STREET_NR, PLOT, [ACC NR], SURNAME, SWM_NR, SITEACCESS, REMARKS, COMMENTS, TOTAL, SUC, 1ST, 2ND, 3RD, [EMPTY/BUILDING/DEMOLISH], REFUSED, FAULTY, NO_METER, SUB, CREDIT, DateMonthStart, DateMonthEnd, DateImported )
SELECT tblApr24_temp.DateCap, tblApr24_temp.TEAM, tblApr24_temp.METER_NR, tblApr24_temp.KRN, tblApr24_temp.STREET, tblApr24_temp.AREA, tblApr24_temp.STREET_NR, tblApr24_temp.PLOT, tblApr24_temp.[ACC NR], tblApr24_temp.SURNAME, tblApr24_temp.SWM_NR, tblApr24_temp.SITEACCESS, tblApr24_temp.REMARKS, tblApr24_temp.COMMENTS, tblApr24_temp.TOTAL, tblApr24_temp.SUC, tblApr24_temp.[1ST], tblApr24_temp.[2ND], tblApr24_temp.[3RD], tblApr24_temp.[EMPTY/BUILDING/DEMOLISH], tblApr24_temp.REFUSED, tblApr24_temp.FAULTY, tblApr24_temp.NO_METER, tblApr24_temp.SUB, tblApr24_temp.CREDIT, tblApr24_temp.DateMonthStart, tblApr24_temp.DateMonthEnd, Now() AS X
FROM tblApr24_temp;
 
Really depends on what your keys or validation rules are are?
 

Users who are viewing this thread

Back
Top Bottom