The order of fields in the table is irrelevant - your query specifies the list
of fields into which the data will be inserted in the parentheses in the
INSERT INTO clause, which should match the *data* in the fields in the SELECT
clause. The names need not be the same, but you should be sure you're matching
them correctly.
There is one condition where the upload table field is OtherL, and the
time table field is HolidayL. I thought I accounted for that in the
query, but may need to add specific criteria that states where
[UploadTable].[OtherL]=[TimeTable].[HolidayL]. Could that be it?
Thanks.
This I don't understand. Criteria would just limit which *records* are
inserted. If your query has
INSERT INTO [TimeTable] (... , HolidayL, ....)
SELECT ... , [OtherL], ...
in matching positions you should be fine.
Where are you seeing this Expr1: showing up? Is that text being inserted into
your output table, or are you opening a datasheet based on the append query,
or what??
--
When I open the design view of the Append (insert) query, in the Field
Names fields from the Upload Time table, the field names have changed
from EmployeeID to Expr1:EmployeeID, and ActivityDate to
Expr2:ActivityDate. The field names in the Append To: fields remain
correct. I correct the field names, save. When I re-open the
database, they have changed back to the Expr# format. thanks, again,
for your thoughts.- Hide quoted text -
- Show quoted text -
Here's how the sql changes:
INSERT INTO [Time TestNLU] (EmployeeID, ActivityDate, OKIL, PaidL,
HolidayL, YDAdmin, YDHost, YDOut, YDColl, YDTTA, YDP2P, YDPDev,
YDEval, YDOther, RHYTC, RHYTAC, RFT, DDSD, TRAUMA, JPTP, PARB, TCEO,
Pool )
SELECT [Upload Time TestNLU].EmployeeID AS Expr1, [Upload Time
TestNLU].ActivityDate AS Expr2, [Upload Time TestNLU].OKIL AS Expr3,
[Upload Time TestNLU].[OtherL] AS Expr1, [Upload Time
TestNLU].HolidayL AS Expr4, [Upload Time TestNLU].YDAdmin AS Expr5,
[Upload Time TestNLU].YDHost AS Expr6, [Upload Time TestNLU].YDOut AS
Expr7, [Upload Time TestNLU].YDColl AS Expr8, [Upload Time
TestNLU].YDTTA AS Expr9, [Upload Time TestNLU].YDP2P AS Expr10,
[Upload Time TestNLU].YDPDev AS Expr11, [Upload Time TestNLU].YDEval
AS Expr12, [Upload Time TestNLU].YDOther AS Expr13, [Upload Time
TestNLU].RHYTC AS Expr14, [Upload Time TestNLU].RHYTAC AS Expr15,
[Upload Time TestNLU].RFT AS Expr16, [Upload Time TestNLU].DDSD AS
Expr17, [Upload Time TestNLU].TRAUMA AS Expr18, [Upload Time
TestNLU].JPTP AS Expr19, [Upload Time TestNLU].PARB AS Expr20, [Upload
Time TestNLU].TCEO AS Expr21, [Upload Time TestNLU].Pool AS Expr22
FROM [Upload Time TestNLU];
Notice in the Select statement how the Select field name that
corresponds to the Insert field name PaidL not only reverts back to
Expr1 (rather than Expr4), but it changes the Select field name to
OtherL from PaidL- when the append query is in it's corrected form,
the Select and Insert matching field names are PaidL. Then the next
Insert field name is HolidayL, and the matching Select field name in
the correct version is OtherL. These are the only two fields that seem
to be inconsistent in the Expr# format.