G
Guest
I am trying to (i) take an existing table, scan it, and identify records
where 4 particular fields match and the sum of another field is zero. and
then (ii) update a different field on both/any records that qualify
I am trying to learn how to build part (i) by using a Find Duplicates query,
hoping I could then take the expression, amend it and insert it into the
field to be used in an IIF statement within an Update Table query...but
that's getting ahead of myself.
The table id Edit Transactions.
The four fields to match are AAA, BBB, CCC and DDD
The field whose sum should be 0 is EEE
Anyways, this is what the Find Duplicates query produced:
In (SELECT [AAA] FROM [Edit Transactions] As Tmp GROUP BY
[AAA],[BaBB],[CCC],[DDD],[EEE] HAVING Count(*)>1 And [BBB] = [Edit
Transactions].[BBB] And [CCC] = [Edit Transactions].[CCC] And [DDD] = [Edit
Transactions].[DDD] And [EEE] = [Edit Transactions].[EEE])
Doesn't work obviously...it matches on all 5 fields instead, not bad, but I
cannot amend the last statement to
[EEE] = -1*[Edit Transactions].[EEE]
or
[EEE] + [Edit Transactions].[EEE] = 0
or anything to make it work...and reading the other posts on Duplicates
querying is difficult so far...
Any ideas, please let me know.
Txs,
Tom
where 4 particular fields match and the sum of another field is zero. and
then (ii) update a different field on both/any records that qualify
I am trying to learn how to build part (i) by using a Find Duplicates query,
hoping I could then take the expression, amend it and insert it into the
field to be used in an IIF statement within an Update Table query...but
that's getting ahead of myself.
The table id Edit Transactions.
The four fields to match are AAA, BBB, CCC and DDD
The field whose sum should be 0 is EEE
Anyways, this is what the Find Duplicates query produced:
In (SELECT [AAA] FROM [Edit Transactions] As Tmp GROUP BY
[AAA],[BaBB],[CCC],[DDD],[EEE] HAVING Count(*)>1 And [BBB] = [Edit
Transactions].[BBB] And [CCC] = [Edit Transactions].[CCC] And [DDD] = [Edit
Transactions].[DDD] And [EEE] = [Edit Transactions].[EEE])
Doesn't work obviously...it matches on all 5 fields instead, not bad, but I
cannot amend the last statement to
[EEE] = -1*[Edit Transactions].[EEE]
or
[EEE] + [Edit Transactions].[EEE] = 0
or anything to make it work...and reading the other posts on Duplicates
querying is difficult so far...
Any ideas, please let me know.
Txs,
Tom