C
Capt Jim Cook
I have a table of work orders that has a primary key on OrderNumber. About
8:00 to 10:00 every morning we download new work orders from the mainframe
(using a text report that is parsed via a query). The mainframe report lists
all orders created anytime yesterday or today (several orders drop about 4:00
am and we want these listed on todays worksheets). I'm using an append query
and it works fine. There are some duplicate records (orders created 4:00
a.m. yesterday get reported again on todays report), but they get thrown away
due to the primary key in the history table. That's exactly what we wanted
the system to do.
However, reporting requirements have changed. The tables contain:
Order # - unique id for the order
Created date - Julian date when the order was created
Pick date - Julian date when the items were picked in the warehouse for
shipment
Orders can be created anytime of day, but our warehouse only picks items on
the day or evening shift.
Yesterday's transactions will have a Pick_date of 0 for orders created after
midnight because our pickers don't start until after the mainframe report is
run. That means today's mainframe report will have a valid [Pick_date] but
these transactions get thrown away due to the duplicate key.
My question is this: Can an update query both update matching transactions
and append new (not matching on Order#) transactions? Do I need to perform
two separate queries: update first and append second?
Thanks,
Jim
8:00 to 10:00 every morning we download new work orders from the mainframe
(using a text report that is parsed via a query). The mainframe report lists
all orders created anytime yesterday or today (several orders drop about 4:00
am and we want these listed on todays worksheets). I'm using an append query
and it works fine. There are some duplicate records (orders created 4:00
a.m. yesterday get reported again on todays report), but they get thrown away
due to the primary key in the history table. That's exactly what we wanted
the system to do.
However, reporting requirements have changed. The tables contain:
Order # - unique id for the order
Created date - Julian date when the order was created
Pick date - Julian date when the items were picked in the warehouse for
shipment
Orders can be created anytime of day, but our warehouse only picks items on
the day or evening shift.
Yesterday's transactions will have a Pick_date of 0 for orders created after
midnight because our pickers don't start until after the mainframe report is
run. That means today's mainframe report will have a valid [Pick_date] but
these transactions get thrown away due to the duplicate key.
My question is this: Can an update query both update matching transactions
and append new (not matching on Order#) transactions? Do I need to perform
two separate queries: update first and append second?
Thanks,
Jim