J
Juan Melero
Heres the situation. I have two tables.
tbl_schedule_delivery has attributes
Id.....Primary key.
shipper
Dest_Unit
Eff_Date
FD
FR
F2
FX.
Then table
tbl_variance
Id....Primary Key
shipper
Dest_Unit
Del_Type
Delivery_Dt
The situation is that table tbl_variance gets values
inputted every day or every other day.
tbl_shedule_deliveries only gets update every time a
schedule changes for a particular Dest_Unit. For example
in table tbl_schedule_deliveries we would have values
Id shipper Dest_Unit Eff_Date FD FR F2 FX
1 0449 1008 1/1/03 1 1 0 0
2 0449 1009 1/1/03 1 1 1 0
3 0449 1008 3/1/03 2 1 0 0
4 0449 1007 1/1/03 1 0 0 0
5 0449 1009 4/3/03 1 1 0 1
Now in table tbl_variance we would have these values
Id shipper Dest_Unit Del_Type Delivery_Dt Cancel
201 0449 1008 FD 1/1/03 No
202 0449 1009 FR 1/1/03 No
203 0449 1008 FR 1/2/03 No
204 0449 1007 FD 1/2/03 No
205 0449 1008 FD 1/3/03 Yes
..
..
..
234 0449 1008 FD 2/29/03 Yes
235 0449 1008 FD 3/1/03 Yes
236 0449 1008 FR 3/2/03 Yes
So here is what I need. I need a query that ties in the
delivery_dt and the effective date for a particular
dest_unit. For example I would like to see a query that
displays the following
shipper Dest_Unit Eff_Date Delivery_Dt Del_Type
0449 1008 1/1/03 1/1/03 FD
0449 1008 1/1/03 1/2/03 FR
0449 1008 1/1/03 1/3/03 FD
0449 1008 1/1/03 1/4/03 ..
....
....
0449 1008 1/1/03 2/29/03 FD
0449 1008 3/1/03 3/1/03 FD
0449 1008 3/1/03 3/2/03 FR
I hope this example explains what I need.
tbl_schedule_delivery has attributes
Id.....Primary key.
shipper
Dest_Unit
Eff_Date
FD
FR
F2
FX.
Then table
tbl_variance
Id....Primary Key
shipper
Dest_Unit
Del_Type
Delivery_Dt
The situation is that table tbl_variance gets values
inputted every day or every other day.
tbl_shedule_deliveries only gets update every time a
schedule changes for a particular Dest_Unit. For example
in table tbl_schedule_deliveries we would have values
Id shipper Dest_Unit Eff_Date FD FR F2 FX
1 0449 1008 1/1/03 1 1 0 0
2 0449 1009 1/1/03 1 1 1 0
3 0449 1008 3/1/03 2 1 0 0
4 0449 1007 1/1/03 1 0 0 0
5 0449 1009 4/3/03 1 1 0 1
Now in table tbl_variance we would have these values
Id shipper Dest_Unit Del_Type Delivery_Dt Cancel
201 0449 1008 FD 1/1/03 No
202 0449 1009 FR 1/1/03 No
203 0449 1008 FR 1/2/03 No
204 0449 1007 FD 1/2/03 No
205 0449 1008 FD 1/3/03 Yes
..
..
..
234 0449 1008 FD 2/29/03 Yes
235 0449 1008 FD 3/1/03 Yes
236 0449 1008 FR 3/2/03 Yes
So here is what I need. I need a query that ties in the
delivery_dt and the effective date for a particular
dest_unit. For example I would like to see a query that
displays the following
shipper Dest_Unit Eff_Date Delivery_Dt Del_Type
0449 1008 1/1/03 1/1/03 FD
0449 1008 1/1/03 1/2/03 FR
0449 1008 1/1/03 1/3/03 FD
0449 1008 1/1/03 1/4/03 ..
....
....
0449 1008 1/1/03 2/29/03 FD
0449 1008 3/1/03 3/1/03 FD
0449 1008 3/1/03 3/2/03 FR
I hope this example explains what I need.