Jump to content
  • 0

Splitting up a record with same ID


kpcollier

Question

Hello. I am having a problem. Right now, I have a DB that holds all of our records of orders for materials. Each order needs an Order_ID automatically generated once it is created. 

Now, say the order was for 15 windows. There should be a record in the table for that order. But, if 5 of the windows are on backorder, I need to be able to "split" that order up, showing that 10 windows are coming at X time and 5 windows are coming at a later date. But they need to share the same Order_ID.

So, if I put the order in for 15 windows and the Order_ID is 1234, after the split I need to be able to look it up as Order_ID 1234-1 and 1234-2 (or something like this) for the separate shipping dates, for the same order.

It sounds a little confusing, but if you need a better explanation I would be more than happy to try to give one through PM. 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

So I assume if you don't set your order ID field to unique, you can have more  multiple order lines in the table under one order ID . Then set up another field as a Suborder Field. 

Order ID  Sub order

1234           1

1234            2

Another way is to have yes/no field called backorder. 

 

Link to comment
Share on other sites

  • 0

Also, as I've been trying to work on this, I can't seem to get a subID working either. I have a trigger, that when "Split" is checked, duplicates the record. The trigger has Sub_ID = Field #inserted.Sub_ID + 1.

*Edit

I've tried changing it so Sub_ID = (0) + (1). So, now the 2nd part of the split (i.e. the backordered group) has a Sub_ID of 1. However, this only works with one split, and does not give the original order a SubID.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...