English 中文(简体)
多战-多战初级关键字
原标题:Multi-Field Primary Key

由于我无法理解的原因,提供我表格的人对表格中的20k+条目没有任何形式的单一域名。

我有两块田地,建筑守则和房间守则,它们共同构成一个独特的房间。例如:

BuildingCode    RoomCode    OtherInfo
001             100A        This is room 100 A in building 1
001             101         Different room in the same building
002             100A        This is still unique, even though two 100As exist

我知道我可以将这两个字段的索引用“MainIndex”来表示,并且确保不出现重复。 我不知道该如何做是允许用另一张表格来表示其中一个房间是其父(一个与许多关系 ) 。

在我的计算机表格中,我想提及一个具体的房间,也就是说,我希望确保会议室参考文件是指一个独特的房间。

ComputerSN     RoomRef
ABC123         001-100A
ABC124         002-100A

我不能改变特定会议室表格的布局,因为这些表格采用了更新数据的方式(在会议室表格中)。

任何帮助都是十分感谢的!

最佳回答

room ref 应由两个字段组成,以匹配数据。然后简单到可以加入查询。例如,

 SELECT DataTable.BuildingCode, DataTable.RoomCode, Count(DataTable.RoomCode)
 FROM DataTable
 INNER JOIN LookUpTable
 ON DataTable.BuildingCode = LookUpTable.BuildingCode
 AND DataTable.RoomCode= LookUpTable.RoomCode
 GROUP BY DataTable.BuildingCode, DataTable.RoomCode

或有关于。

问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

access query to filter and combine count

i have two access tables tableA num count 1 7 2 8 3 9 4 9 5 13 6 6 tableB num count 0 1 1 14 2 12 3 5 4 5 5 11 6 5 how can i create an access query that ...

How to show File Picker dialog in Access 2007?

I want to show a dialog where the user can pick a file, click OK, and then the path to the file will be saved in the database. I have just one problem, I can t figure out how tho show the dialog ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

Returning row number on MS Access

I have 4 tables, from which i select data with help of joins in select query...I want a serial no.(row number) per record as they are fetched. first fetched record should be 1, next 2 and so on... In ...

热门标签