I have an order table and lab results table. The field I am joining the tables on is OrderID, but it's not unique because if the patient is given multiple tests, each test has the same OrderID. I need to update some tests but not all of them, so I need to get to the test level to evaluate each record. I want to create a new OrderId by using the existing OrderID(ex. PRO12345) and adding a sequence number at the end(ex. PRO12345-1, PRO12345-2, etc) for each test. Then I want to add this new OrderID to my order and lab result tables to use as a join for my update. How do I do this??
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.