Update a boolean field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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);
 
Thanks, it worked!

KARL DEWEY said:
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 said:
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
 
Back
Top