new at queries-can I do this one?

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

Guest

Hi. Looking for help with a query.
I have a db of 65,000 auto parts (Parts Table). They need to be matched to a tariff db (Tariff Table) as follows:
In Parts Table there is a column called Current HTS. I need that column/field to search the Tariff Table to look for the same number in a column called Proper HTS.
First, what I want it to do is flag that part if there is no HTS number shown at all (maybe by adding smething to a new column I can add) so that it gets the attention of someone to classify it.
Secondly, if there is a number in the Current HTS field, I want it to match with the same number in the Proper HTS column in the Tarriff table and carry the info from it's accompanying field called HTS Description back to the Parts Table.
Am I clear?
Can anyone help - remember I'm new at designing queries, so please talk in basic, easy to understand terms.
Thanks so much!
 
Create two seperate queries:
F11 and select the Queries Object from the left pane. Above that select
New.....Design View.
Use the Query builder and select the parts and tarrif tables.(double click
the table names) Join the tables on the unique column ( say PartNumber) and
by the HTS field by selecting partnumber in the parts table and dragging it
onto the partnumber of the tarrif table, do the same with the HTS field. Now
select the "join line" for the HTS fields and right click it. A popup menu
will display and select join properties from it. In the box that appears
select the radio button that says "Select All records from Parts and only
those records from tarrif where the joined fields are equal." Now go to both
tables and double click the PartNumber fields and HTS fields. Find the HTS
field from the tarrif table and enter the criteria field below it and type
in Is Null . This will give you all the records that have no HTS
information from the tarrif table. Now on the icon menu at the top (above
the query window) click the dropdown arrow to the left of the Red
Exclamation "Run" button and select Update Query. Now just above the Is Null
you just typed in in the Update To: field type the value you want to use to
"Flag" the record.

Next: This one is easier!!!!

Now create a query from the same two tables and join them on only the
PartNumber field. Select the HTS field from the Parts table and below it in
the criteria field use <> Tarrif.HTS. Make this an Update query as
well and use the Update To field to =Tarrif.HTS. Now also Update the
Description field of the Parts table with the Description from the Tarrif
table.

HTH

zirkerc said:
Hi. Looking for help with a query.
I have a db of 65,000 auto parts (Parts Table). They need to be matched to
a tariff db (Tariff Table) as follows:
In Parts Table there is a column called Current HTS. I need that
column/field to search the Tariff Table to look for the same number in a
column called Proper HTS.
First, what I want it to do is flag that part if there is no HTS number
shown at all (maybe by adding smething to a new column I can add) so that it
gets the attention of someone to classify it.
Secondly, if there is a number in the Current HTS field, I want it to
match with the same number in the Proper HTS column in the Tarriff table and
carry the info from it's accompanying field called HTS Description back to
the Parts Table.
Am I clear?
Can anyone help - remember I'm new at designing queries, so please talk in
basic, easy to understand terms.
 
Back
Top