P
phenderson
Hi,
I've recently inherited an older system and need to create a query.
The query will pull data from two tables:
tblA
----
prod_id -- pk, identity seed 1
prod_name
tblB
id -- pk, identity seed 1
prod_id -- fk pd.tblA
dept
dt_complete
My client wants to see how much time a specific product spent in given
department. Unfortunately, the database isn't designed quite right as
there's no field in tblB for date received. So, the client wants the
lag time to be calculated by getting the difference between the date
completed for a given department and the date completed for the
department where the product was previously. For example, if Product
001 was completed in Department YY on 11/9/2006 and completed in
Department ZZ on 11/16/2006, they want to say that it took Department
ZZ 7 days to complete Product 001.
I can provide more descriptions if necessary. Thanks in advance for
any assistance you can give.
I've recently inherited an older system and need to create a query.
The query will pull data from two tables:
tblA
----
prod_id -- pk, identity seed 1
prod_name
tblB
id -- pk, identity seed 1
prod_id -- fk pd.tblA
dept
dt_complete
My client wants to see how much time a specific product spent in given
department. Unfortunately, the database isn't designed quite right as
there's no field in tblB for date received. So, the client wants the
lag time to be calculated by getting the difference between the date
completed for a given department and the date completed for the
department where the product was previously. For example, if Product
001 was completed in Department YY on 11/9/2006 and completed in
Department ZZ on 11/16/2006, they want to say that it took Department
ZZ 7 days to complete Product 001.
I can provide more descriptions if necessary. Thanks in advance for
any assistance you can give.