data comparison/update query

T

Tony in Michigan

I need to compare many data fields, and report the items that fail the
comparison, so this would apply to a number of the projects I'm working on.

table 1 three fields, f1=part num, f2=tariff (6 char), f3=validation flag
Table 2 eight fields, only need F1 & F2 (10 Char), named as above

I want to ecompare T1.F1 to T2.F1 and update T1.F3 to invalid, when
T1.F2-left(T2.F2,6) <>0

Also, as i feel like a pain in the message board, are there any good SQL
references for Access, that will help me along?
 
K

KARL DEWEY

First thing to do is backup database.
If T1.F3 is a Yes/No field then change = “invalid†to = -1

UPDATE T1 INNER JOIN T2 ON T1.F1 = T2.F1 SET T1.F3 = “invalidâ€
WHERE (T1.F2)-(left(T2.F2,6)) <>0;
 
T

Tony in Michigan

Thank you Karl!

Getting the commands to work correctly has always been my big issue ....
this goes all the way back to basic on the trash-80 and the original IBM
basica on my first 16K pc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top