Query Issue

jersey417

New Member
Joined
Jun 29, 2011
Messages
4
Hello all,
First time poster long time reader. I’m running into a problem on writing a query that I need some additional help completing. Below is an example of a form I’m trying to run a query off. However, if the inventory level is zero it will not be listed on the form(I can not edit the form). I need all the part numbers, including those with zero inventory, to be represented in my queries.


Part number ----- Inventory
1234 -------------100
ABCD ------------546
9876 -------------32



Example – If I try to query part number BBBB from the example form above currently it will not be represented since it has zero inventory. I’m looking to have the return results look like

Part---------------Inventory
BBBB -------------0


What would be the best way to have all part numbers and their respected inventories represented in my queries?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Sorry, misused the term form/table. Corrected below

----------

Hello all,
First time poster long time reader. I’m running into a problem on writing a query that I need some additional help completing. Below is an example of a table I’m trying to run a query off. However, if the inventory level is zero it will not be listed on the table(I can not edit the form). I need all the part numbers, including those with zero inventory, to be represented in my queries.


Part number ----- Inventory
1234 -------------100
ABCD ------------546
9876 -------------32



Example – If I try to query part number BBBB from the example table above currently it will not be represented since it has zero inventory. I’m looking to have the return results look like

Part---------------Inventory
BBBB -------------0


What would be the best way to have all part numbers and their respected inventories represented in my queries?[/QUOTE]
 
Upvote 0
Your best bet is to make a master table with all the part numbers on it.
You can still have the inventory table in it's current format.

Your query will then look something like this:-
Code:
SELECT
     tbl_Parts_Master.Part_Code,tbl_Inventory_Volume
FROM
     tbl_Parts_Master left join tbl_Inventory on tbl_Parts_Master.Part_Code=tbl_Inventory_Volume.Part_Code

The syntax of the above might be a bit adrift but should get you started.
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top