Find what materials were allocated for previous orders


New member
Sep 14, 2018
Programming Experience
I work for a company that sells metal.
There are many different specs to what the metal can be.
example: several coatings types to choose from for front and/or back, rolls or sheets of metal, smooth or flat, several polish types, number of cuts, etc.
When an order is entered, the specs are entered in by the sales teams. These requested specs are distributed to 4 different tables, in (2008 SQL Server) (OE_ORDER, OE_LINE, OE_ALLOCATIONS, OE_CUTTING.)

I was told to assign each unique set of specs an ID(ID_No), and record the first day it was entered (Initial_DT) and the last time the spec was ordered(Last_Dt) and how many times this particular set of specs was ordered (Times_Used) and put all the information into 4 different tables that was created by a team member. (currently the tables do not have data)

My team member wants me to create a VS 2015 program where the user can enter in an order number (ord_no) into a text box and click a button. The program will look in the 4 new tables to see if that combination of specs and/or ord_no was already requested.

Spreadsheet with all tables is attached.
View attachment Tables For

If the specs are already in the new tables then I need to add 1 to my Times_Used column and change Last_Dt and record the ord_no, line_no, and cus_no in the new tables. And display a message to the user "This configuration has been used 'x' amount of times on 'x' First_Dt, 'x' Last_Dt, on these 'x' ord_no's.

If it has not been requested it will go out and look at the 4 tables where the sales order was entered and assign an ID_No to that new set of specific specs and distribute the specs to 4 tables he created that currently do not contain any data and a message will pop up saying "This is the first time these specs have been requested"

My question is: Is there an easier way to do this? For example, can the user put in an order number and when he clicks the button it could give him the results I want? By using COUNT, or DISTINCT?

Thank you