新访问:从2个单独的表中获取数据并组合到单个表中 [英] New to access: take data from 2 separate tables and combine to single table
问题描述
我有2张桌子。表1:该型号每周所需的型号和数量
表2:不同型号和用途所需的部件(部件所需的次数)在那个型号中使用)
现在,我需要得到那个星期我需要的零件数量。
将通过表2查看并按部件编号对它们进行分组(所有相同的部件编号如第1-4行一样)然后获取型号名称。
从那里,使用表1获取该模型所需的数量。并重复上述其他使用相同部件的型号。
非常感谢你!
我尝试了什么:
我是VBA的新手以及Access这样的我真的不是知道如何去做。以及是否可以在Access中进行此操作以及查询是否会更好。
我正在查看几个Access vba视频,但它们似乎没有什么帮助
I have 2 tables. Table 1: Model number and the quantity needed every week for that model
Table 2: The parts needed for the different Models and the usage( number of times that part will be used in that model)
Right now, i need to go about getting the number of parts that I need in total for that week.
Which will be to go look through Table 2 and group them by part number(all the same part numbers are together like row 1-4) and then getting the model name.
From there, using table 1 to get the quantity needed for that model. and repeating the above for the other models that use the same part.
Thank you so much!
What I have tried:
Im new to VBA as well as Access as such I dont really know how to go about doing it. and whether this is possible in Access and if a Query will be much better to do it.
Im looking through a couple of Access vba videos but they dont really seem helpful
推荐答案
您不需要VBA。您需要的只是创建正确的查询。请参阅:
Access中的查询提示和技巧2007 [ ^ ] - 强烈推荐!
内部联接操作(Microsoft Access SQL) [Access 2007 Developer Reference] [ ^ ]
LEFT JOIN,RIGHT JOIN操作(Microsoft Access SQL) [Access 2007 Developer Reference] [ ^ ]
V SQL连接的表示形式 [ ^ ]
不要偷懒并试试!
You don't need VBA. All what you need is to crate proper query. See:
Tips and Techniques for Queries in Access 2007[^] - strongly recommended!
INNER JOIN Operation (Microsoft Access SQL) [Access 2007 Developer Reference][^]
LEFT JOIN, RIGHT JOIN Operations (Microsoft Access SQL) [Access 2007 Developer Reference][^]
Visual Representation of SQL Joins[^]
Don't be lazy and try!
这篇关于新访问:从2个单独的表中获取数据并组合到单个表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!