shaboo
11th September 2004, 04:28
Background:
In our system, we have quite a few items that have become obsolete and have been replaced be newer items. These newer items do not have 'Issue History' (tdinv750 & tdinv760) and we would like to use the history of obsolete items so that we can forecast our newer items better. We have decided to create a session that will copy the history from a source (Obsolete) Item to a Target (Newer) Item.
Problem:
I understand that it is not possible to have two active references to same table more than once. Hence I am wondering how can I take the recordset of source item, compare it with the recordset of target item and then either update or insert the issue history in a period, one period at a time.
The way I have done right now is to open the recordset of target item (for example from tdinv750) and stored the values in to some variables. Then I have reset the field values of source item (tdinv750.xxxx) and opened the recorset of target item from same table for update. I had to reset the field values of source item to empty/zero as otherwise as soon as I will open the recorset of target item, the values of target item will get automatically set from source item recordset. So after opening the recordset for update, I will compare the values in the target item from those variables and update the issue history based on some logic.
My question is, is there a way I can do the above without having to define variables. Can I define two different pointers to same table and if yes, how can I use them in query? How would I refer to the table fields of these two different pointers, if at all possible?
Your help will be much appreciated.
In our system, we have quite a few items that have become obsolete and have been replaced be newer items. These newer items do not have 'Issue History' (tdinv750 & tdinv760) and we would like to use the history of obsolete items so that we can forecast our newer items better. We have decided to create a session that will copy the history from a source (Obsolete) Item to a Target (Newer) Item.
Problem:
I understand that it is not possible to have two active references to same table more than once. Hence I am wondering how can I take the recordset of source item, compare it with the recordset of target item and then either update or insert the issue history in a period, one period at a time.
The way I have done right now is to open the recordset of target item (for example from tdinv750) and stored the values in to some variables. Then I have reset the field values of source item (tdinv750.xxxx) and opened the recorset of target item from same table for update. I had to reset the field values of source item to empty/zero as otherwise as soon as I will open the recorset of target item, the values of target item will get automatically set from source item recordset. So after opening the recordset for update, I will compare the values in the target item from those variables and update the issue history based on some logic.
My question is, is there a way I can do the above without having to define variables. Can I define two different pointers to same table and if yes, how can I use them in query? How would I refer to the table fields of these two different pointers, if at all possible?
Your help will be much appreciated.