Hi,
I am trying to write an update query without much success! I have the following 2 tables:
TABLE_A
Account_ID
Sub_Account_ID
Sub_Account_Adj
Issue_Flag
TABLE_B
Account_ID
What I need to do is set the Issue_Required_Flag from 0 to 1 in TABLE_A where the Account_ID exists in TABLE_B, but only on the latest record in TABLE_A.
For example, assume TABLE_A contains the following records for a partcular account:
Account_ID Sub_Account_ID Sub_Account_Adj Issue_Flag
11111111 1 1 0
11111111 1 2 0
11111111 2 1 0
11111111 2 2 0
11111111 2 3 0
and assuming Account_ID 11111111 exists in TABLE_B, I would want to set the Issue_Flag to 1 for the record:
Account_ID Sub_Account_ID Sub_Account_Adj Issue_Flag
11111111 2 3 0
Apologies for the rather long-winded description, but I seem to be going round in circles!
Many thanks for any help.
I am trying to write an update query without much success! I have the following 2 tables:
TABLE_A
Account_ID
Sub_Account_ID
Sub_Account_Adj
Issue_Flag
TABLE_B
Account_ID
What I need to do is set the Issue_Required_Flag from 0 to 1 in TABLE_A where the Account_ID exists in TABLE_B, but only on the latest record in TABLE_A.
For example, assume TABLE_A contains the following records for a partcular account:
Account_ID Sub_Account_ID Sub_Account_Adj Issue_Flag
11111111 1 1 0
11111111 1 2 0
11111111 2 1 0
11111111 2 2 0
11111111 2 3 0
and assuming Account_ID 11111111 exists in TABLE_B, I would want to set the Issue_Flag to 1 for the record:
Account_ID Sub_Account_ID Sub_Account_Adj Issue_Flag
11111111 2 3 0
Apologies for the rather long-winded description, but I seem to be going round in circles!
Many thanks for any help.