G
Guest
I am comparing two fields (the same) in two tables. If the first field
matches in both tables and the second field does not match I want it to
append from the first table to the second table.
In a query ... two tables ... two fields that are identical in both tables.
'Acct #' and 'Closure Date'
In the 'Closure Date' field under Criteria I have the following...
<>([History Table ALL].[Closure Date])
This is what is in the First Table
1 06-05-06
255 06-05-06
255 06-20-06
This is what is in the Second Table (that I am comparing the First Table with)
1 06-05-06
255 06-05-06
255 06-20-06
255 06-20-06
255 06-20-06
255 06-20-06
After running the query I get back the result of 255 06-20-06
This is obviously in the second table, so why does it keep returning this
value.
The following is the complete sql script.
INSERT INTO [History Table ALL] ( [Acct #], [Closure Date], [Reason Code #],
Exclude, Notes, [Closure Type] )
SELECT [ccInput Table].[Acct #], [ccInput Table].[Closure Date], [ccInput
Table].[Reason Code #], [ccInput Table].Exclude, [ccInput Table].Notes,
[ccInput Table].[Closure Type]
FROM [ccInput Table] LEFT JOIN [History Table ALL] ON [ccInput Table].[Acct
#] = [History Table ALL].[Acct #]
WHERE ((([ccInput Table].[Closure Date])<>([History Table ALL].[Closure
Date])))
ORDER BY [ccInput Table].[Acct #];
Hope I have given you adequate information. If not, let me know.
Thank you.
matches in both tables and the second field does not match I want it to
append from the first table to the second table.
In a query ... two tables ... two fields that are identical in both tables.
'Acct #' and 'Closure Date'
In the 'Closure Date' field under Criteria I have the following...
<>([History Table ALL].[Closure Date])
This is what is in the First Table
1 06-05-06
255 06-05-06
255 06-20-06
This is what is in the Second Table (that I am comparing the First Table with)
1 06-05-06
255 06-05-06
255 06-20-06
255 06-20-06
255 06-20-06
255 06-20-06
After running the query I get back the result of 255 06-20-06
This is obviously in the second table, so why does it keep returning this
value.
The following is the complete sql script.
INSERT INTO [History Table ALL] ( [Acct #], [Closure Date], [Reason Code #],
Exclude, Notes, [Closure Type] )
SELECT [ccInput Table].[Acct #], [ccInput Table].[Closure Date], [ccInput
Table].[Reason Code #], [ccInput Table].Exclude, [ccInput Table].Notes,
[ccInput Table].[Closure Type]
FROM [ccInput Table] LEFT JOIN [History Table ALL] ON [ccInput Table].[Acct
#] = [History Table ALL].[Acct #]
WHERE ((([ccInput Table].[Closure Date])<>([History Table ALL].[Closure
Date])))
ORDER BY [ccInput Table].[Acct #];
Hope I have given you adequate information. If not, let me know.
Thank you.