jwcoleman87
Well-known member
- Joined
- Oct 4, 2014
- Messages
- 124
- Programming Experience
- Beginner
Okay, so two queries, side by side here:
Keep in mind SKU is just a giant SKU table which describes a part in a very very complete manner. Those two queries bring up information that looks like this:
The first statement:
The second statement:
All this information is coming from a database that looks like this:

What I'd like to do is create records for the locations that are found having a certain product type in them and select the correct partclassification for the table TTLocationClass
I want to simply ask, is your producttype listed here? if it is then your partclassid will be x
I only need a single partclassID per location.
VB.NET:
select PartNumber, ProductType, TTPartInventory.Location, TTPartLocation.LocationID from TTPartInventory
join SKU on TTPartInventory.PartNumber = SKU.ManufacturerPart
join TTPartLocation on TTPartLocation.Location = TTPartInventory.Location
Select PartType, PartClassification From TTPartTypeClass
Join TTPartClass on TTPartTypeClass.PartClassID = TTPartClass.PartClassID
Join TTPartType on TTPartTypeClass.PartTypeID = TTPartType.PartTypeID
Keep in mind SKU is just a giant SKU table which describes a part in a very very complete manner. Those two queries bring up information that looks like this:
The first statement:
VB.NET:
PartNumber ProductType Location LocationID
501552-001 DOOR A01 1
531215-001 CIRCUIT BOARD A01 1
60.M8EN2.007 CASES A01 1
607750-001 COVER A01 1
620594-001 BEZELS A01 1
The second statement:
VB.NET:
PartType PartClassification
BEZELS Large Plastics
BASES Large Plastics
CASES Large Plastics
COVER Large Plastics
HARDWARE Hardware and stuff
BRACKETS Hardware and stuff
SPEAKER Hardware and stuff
DOOR Hardware and stuff
FAN Hardware and stuff
HEATSINK Hardware and stuff
All this information is coming from a database that looks like this:

What I'd like to do is create records for the locations that are found having a certain product type in them and select the correct partclassification for the table TTLocationClass
I want to simply ask, is your producttype listed here? if it is then your partclassid will be x
I only need a single partclassID per location.