Query Multiple Fields

Dr_Worm

Board Regular
Joined
Jul 28, 2003
Messages
103
Hi

I have a table with the fields “Level, Room, Type, Component1, Qty1, Component2, Qty2, Component3, Qty3….”

I need to create a query (or whatever is needed) to create a recordset with:
Level, Room, Type, Component1, Qty1
Level, Room, Type, Component2, Qty2
Level, Room, Type, Component3, Qty3….
And if Qty is Null no record is created.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
[Sermon on] If you really have created a table with a list of components with matching Qty fields you probably need to reconsider your table design if you have not committed to far.
It would be best to have one table with a Key field, Level, Room, Type and another with the Key field from the first table and Component and qty. when you link these together you are able to have as many components numbers as required. This means when someone decides that they need one more than you have allowed for (inevitable!) you don't have to re-write have the database to accommodate it!
Web Monkey has an article about table relationships that is worth a look [/Sermon Off]

To achieve what you want with the existing layout I think that you will need to create a query for each component number and then join them all up again with a Union Query.


HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,572
Messages
6,160,575
Members
451,656
Latest member
SBulinski1975

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