>>I have not seen TIW for sometime - but as I recall the SO number is in the TIW header file. So once you have the SO # (I'd get that from straight SBT searches) I think all you would need would be TIW tables. Of course I was just thinking of getting the status of each line item on the SO. It appears that you are doing more that just getting where or what process a line item is in WIP. Am I right? BTW the select statement was very nice.
>>
>>John
>
>It's kind of like that.{grin} TIW is more straight forward {normalized} than SBT. When it's done I'll post the improved sql.
>
>__Stephen
Stephen,
Another thing I've noticed about your select is that your trying to use the master route detail file (RODETAIL) to obtain the operation work center. Shouldn't you actually be using the Work Order route (SOROUTE) to be getting the Work Center actually used on the transaction? If you do it that way, we already have compound index tags on the Work Order # and the operation #. You wouldn't need to add any additional tags, just be sure that the left side of your JOIN statements has the proper fields to match the existing tags key.
FROM sotran LEFT OUTER JOIN soroute ON sotran.sono+STR(sotran.opno,3,0)+sotran.code+sotran.part_grade=soroute.sono+STR(soroute.opno,3)
Works pretty fast for me.