Good afternoon,
I have a table consisting of the following fields:
PO
DateAppended
Status
ShippedDate
ReceivedDate
I created another field that concatenate these five fields together in order to prevent any duplication. This ConCat field is the 6th field and it is my primary field.
I have another table that compares the records with this table, using the concatenation field as foreign key. Any unmatched record (not found), will be appended to this current table.
Each record will be appended to this table when any of these conditions are met:
1. Status has been changed and / or
2. ShippedDate has been changed and /or
3. ReceivedDate has been changed
I have seven statuses;
1-Requested
2-Issued
3-Sent
4-Fulfilled
5-Cancelled
6-onHold
7-Resumed
The logic will be -> the PO is requested -> issued -> send to vendor -> vendor fulfilled PO. At anytime -> the PO can be cancelled or it can be put on hold. It can be resumed after everyone agrees to lift off the on-hold status.
I am using the queries to generate the result. So far, I am 90% successful, if there is no duplicated status.
I include some of the records as an example, based on the field given. (I have not included the concatenated field.)
PO, DateAppended, Status, ShippedDate, ReceivedDate
990,12/1/2005,Requested,12/15/2005, 12/19/2005
990,12/5/2005,Issued, 12/15/2005, 12/19/2005
990,12/7/2005,Issued,12/17/2005, 12/19/2005
990,12/9/2005,Sent,12/17/2005,12/19/2005
990,12/12/2005, onHold,12/17/2005,12/19/2005
990,12/21/2005,Resumed, 12/27/2005, 12/30/2005
990,12/23/2005,Cancelled,12/27/2005,12/30/2005
990,12/28/2005, Cancelled, 12/28/2005,12/28/2005
991,12/2/2005,Requested, 01/15/2006, 01/22/2006
991,12/5/2005,Issued, 01/15/2006, 01/22/2006
991,12/6/2006,Issued, 01/15/2006, 01/24/2006
992,12/3/2005,Requested, 12/22/2005, 12/27/2005
992,12/8/2005,Issued, 12/22/2005,12/27/2005
992,12/9/2005,Issued, 12/26/2005,1/4/2006
992,12/11/2005,Sent, 12/26/2005, 1/4/2006
992,12/13/2005,Sent, 12/31/2005, 1/4/2006
992,12/15/2005,Sent, 12/31/2005, 1/7/2006
992,12/17/2005,Fulfilled, 12/31/2005, 1/7/2006
992,1/8/2006,Fulfilled, 12/31/2005, 1/8/2006
…
…
…
And so on..
…
I am looking for a code that will update the “DateAppended” field to match the first record that status has changed
The query should be grouped by PO:
Examples:
• PO # 990, we would like the DateAppended to be “12/23/2005” on all cancelled status
• PO # 991, we would like the DateAppended to be “12/05/2005” on all Issued status
• PO # 992, we would like the DateAppended to be “12/08/2005” on all Issued status and DateAppended to be “12/11/2005” on all Sent status. The same thing for Fulfilled Status, which should be “12/17/2005”
Can you provide any type of codes that I can get the result above? Thanks.
I have a table consisting of the following fields:
PO
DateAppended
Status
ShippedDate
ReceivedDate
I created another field that concatenate these five fields together in order to prevent any duplication. This ConCat field is the 6th field and it is my primary field.
I have another table that compares the records with this table, using the concatenation field as foreign key. Any unmatched record (not found), will be appended to this current table.
Each record will be appended to this table when any of these conditions are met:
1. Status has been changed and / or
2. ShippedDate has been changed and /or
3. ReceivedDate has been changed
I have seven statuses;
1-Requested
2-Issued
3-Sent
4-Fulfilled
5-Cancelled
6-onHold
7-Resumed
The logic will be -> the PO is requested -> issued -> send to vendor -> vendor fulfilled PO. At anytime -> the PO can be cancelled or it can be put on hold. It can be resumed after everyone agrees to lift off the on-hold status.
I am using the queries to generate the result. So far, I am 90% successful, if there is no duplicated status.
I include some of the records as an example, based on the field given. (I have not included the concatenated field.)
PO, DateAppended, Status, ShippedDate, ReceivedDate
990,12/1/2005,Requested,12/15/2005, 12/19/2005
990,12/5/2005,Issued, 12/15/2005, 12/19/2005
990,12/7/2005,Issued,12/17/2005, 12/19/2005
990,12/9/2005,Sent,12/17/2005,12/19/2005
990,12/12/2005, onHold,12/17/2005,12/19/2005
990,12/21/2005,Resumed, 12/27/2005, 12/30/2005
990,12/23/2005,Cancelled,12/27/2005,12/30/2005
990,12/28/2005, Cancelled, 12/28/2005,12/28/2005
991,12/2/2005,Requested, 01/15/2006, 01/22/2006
991,12/5/2005,Issued, 01/15/2006, 01/22/2006
991,12/6/2006,Issued, 01/15/2006, 01/24/2006
992,12/3/2005,Requested, 12/22/2005, 12/27/2005
992,12/8/2005,Issued, 12/22/2005,12/27/2005
992,12/9/2005,Issued, 12/26/2005,1/4/2006
992,12/11/2005,Sent, 12/26/2005, 1/4/2006
992,12/13/2005,Sent, 12/31/2005, 1/4/2006
992,12/15/2005,Sent, 12/31/2005, 1/7/2006
992,12/17/2005,Fulfilled, 12/31/2005, 1/7/2006
992,1/8/2006,Fulfilled, 12/31/2005, 1/8/2006
…
…
…
And so on..
…
I am looking for a code that will update the “DateAppended” field to match the first record that status has changed
The query should be grouped by PO:
Examples:
• PO # 990, we would like the DateAppended to be “12/23/2005” on all cancelled status
• PO # 991, we would like the DateAppended to be “12/05/2005” on all Issued status
• PO # 992, we would like the DateAppended to be “12/08/2005” on all Issued status and DateAppended to be “12/11/2005” on all Sent status. The same thing for Fulfilled Status, which should be “12/17/2005”
Can you provide any type of codes that I can get the result above? Thanks.