smichaels1234
06-11-2008, 04:46 AM
I need help in getting data. It's pretty complex. I am building a report that originally has an Item Number. The Item Number interacts with the Component Item Number. I need to get the Component Item Number. So far I have one query that goes out and gets every Component Item Number that matches the Item Number. I need to be able to just get the Component Item Number. Like I said, it's extremely complex. Here is my query now. I feel like I need a query behind that runs in a macro to populate the data that I am specifying. Not sure if this makes sense. Here is my query that I need to have in my report:
Here are how the steps should go.
1. I should first be looking for all Item Numbers.
2. Then I should be looking for all the Component Numbers that match the Item Number.
3. Then I should be getting rid of all the Item numbers and just show all the Component Numbers.
SELECT dboBill_of_Materials_Table.Item_Number, dboBill_of_Materials_Table.Component_Item_Number, dboItem_Master_Table.Description, dboBill_of_Materials_Table.Quantity, dboBill_of_Materials_Table.Config_Ctl_SO_Ack, dboBill_of_Materials_Table.Config_Ctl_Shipper
FROM [tbl-Order Items w/Detail] RIGHT JOIN (dboBill_of_Materials_Table INNER JOIN dboItem_Master_Table ON dboBill_of_Materials_Table.Component_Item_Number = dboItem_Master_Table.Item_Number) ON [tbl-Order Items w/Detail].Part_Number = dboBill_of_Materials_Table.Item_Number
WHERE (((dboBill_of_Materials_Table.Config_Ctl_SO_Ack)="D"));
Here are how the steps should go.
1. I should first be looking for all Item Numbers.
2. Then I should be looking for all the Component Numbers that match the Item Number.
3. Then I should be getting rid of all the Item numbers and just show all the Component Numbers.
SELECT dboBill_of_Materials_Table.Item_Number, dboBill_of_Materials_Table.Component_Item_Number, dboItem_Master_Table.Description, dboBill_of_Materials_Table.Quantity, dboBill_of_Materials_Table.Config_Ctl_SO_Ack, dboBill_of_Materials_Table.Config_Ctl_Shipper
FROM [tbl-Order Items w/Detail] RIGHT JOIN (dboBill_of_Materials_Table INNER JOIN dboItem_Master_Table ON dboBill_of_Materials_Table.Component_Item_Number = dboItem_Master_Table.Item_Number) ON [tbl-Order Items w/Detail].Part_Number = dboBill_of_Materials_Table.Item_Number
WHERE (((dboBill_of_Materials_Table.Config_Ctl_SO_Ack)="D"));