If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update a boolean field
I have two tables that are being compared. If field_1 from TABLE B is the
same as field1 from TABLE A, then there QCTV1 field from TABLE A should have a check else is should be left unchecked. How do I do this? Note: TABLE A has many QCTV fields because many fields from TABLE B are being compared to the some fields in TABLE A. TABLE A TABLE B PK field1 QCTV1 field2 QCTV2 PK field_1 field_2 field_3 01 tom NULL VA NULL 01 tom VA 29128 02 Jerry NULL MD NULL 02 Marry MD 79345 |
#2
|
|||
|
|||
Update a boolean field
Back up your database and then try this ---
UPDATE [Table A] INNER JOIN [Table B] ON [Table A].PK = [Table B].PK SET [Table A].QCTV1 = IIf([Table A].[field1]=[Table B].[field1],-1,0), [Table A].QCTV2 = IIf([Table A].[field2]=[Table B].[field2],-1,0); "jac007" wrote: I have two tables that are being compared. If field_1 from TABLE B is the same as field1 from TABLE A, then there QCTV1 field from TABLE A should have a check else is should be left unchecked. How do I do this? Note: TABLE A has many QCTV fields because many fields from TABLE B are being compared to the some fields in TABLE A. TABLE A TABLE B PK field1 QCTV1 field2 QCTV2 PK field_1 field_2 field_3 01 tom NULL VA NULL 01 tom VA 29128 02 Jerry NULL MD NULL 02 Marry MD 79345 |
#3
|
|||
|
|||
Update a boolean field
Thanks, it worked!
"KARL DEWEY" wrote: Back up your database and then try this --- UPDATE [Table A] INNER JOIN [Table B] ON [Table A].PK = [Table B].PK SET [Table A].QCTV1 = IIf([Table A].[field1]=[Table B].[field1],-1,0), [Table A].QCTV2 = IIf([Table A].[field2]=[Table B].[field2],-1,0); "jac007" wrote: I have two tables that are being compared. If field_1 from TABLE B is the same as field1 from TABLE A, then there QCTV1 field from TABLE A should have a check else is should be left unchecked. How do I do this? Note: TABLE A has many QCTV fields because many fields from TABLE B are being compared to the some fields in TABLE A. TABLE A TABLE B PK field1 QCTV1 field2 QCTV2 PK field_1 field_2 field_3 01 tom NULL VA NULL 01 tom VA 29128 02 Jerry NULL MD NULL 02 Marry MD 79345 |
Thread Tools | |
Display Modes | |
|
|