Hey guys,
I have been searching high and low for a solution. I hope you guys can help me on this.
Here is the case:
1 table with duplicate SSN
TableName: CustInfo
Name SSN CustNO Flag
-----------------------------
Ali 1120 78643
Ali 1120 98732
Sammy 345 36791
John 09212
Mia 3344 11224
Mia 3344 78303
Another Table links to CustInfo by CustNo
TableName: AcctInfo
CustNo ActiveDate
----------------------
78643 03/06/2005
98732 09/08/2004
35791 12/01/2001
09212 11/10/2003
11224 12/14/2002
78303 01/29/2006
I am trying to update the record with only the duplicate ssn with a value of 'O' against the earlier date.
The output should be as follows:
TableName: CustInfo
Name SSN CustNO Flag
-----------------------------
Ali 1120 78643
Ali 1120 98732 O
Sammy 345 36791
John 09212
Mia 3344 11224 O
Mia 3344 78303
I have been trying so many methods,I hope there is a way to do it.
Thanks.
-- gyfu --
Crystal Ver 10
Microsoft SQL
I have been searching high and low for a solution. I hope you guys can help me on this.
Here is the case:
1 table with duplicate SSN
TableName: CustInfo
Name SSN CustNO Flag
-----------------------------
Ali 1120 78643
Ali 1120 98732
Sammy 345 36791
John 09212
Mia 3344 11224
Mia 3344 78303
Another Table links to CustInfo by CustNo
TableName: AcctInfo
CustNo ActiveDate
----------------------
78643 03/06/2005
98732 09/08/2004
35791 12/01/2001
09212 11/10/2003
11224 12/14/2002
78303 01/29/2006
I am trying to update the record with only the duplicate ssn with a value of 'O' against the earlier date.
The output should be as follows:
TableName: CustInfo
Name SSN CustNO Flag
-----------------------------
Ali 1120 78643
Ali 1120 98732 O
Sammy 345 36791
John 09212
Mia 3344 11224 O
Mia 3344 78303
I have been trying so many methods,I hope there is a way to do it.
Thanks.
-- gyfu --
Crystal Ver 10
Microsoft SQL