注册数据库的谱系查询 [英] Pedigree query for Registration Database
问题描述
你好,
我已经离开Access几年了,只是想让我的腿回到我身下。
我要创建一个关系马匹数据库。我无法克服的主要障碍是:
主要信息,每条记录都有唯一的注册号(密钥),父亲(父亲)和母亲(母亲)的字段)为每匹马。这些字段也将成为数据库中的马。
我需要能够查询5个世代的谱系(遗产,如果你愿意)。我被困在如何做到这一点。
IE:伟大/伟大的爷爷(G5)
Great Grandad(G4)"奶奶
Grandad(爸爸)(G3)Great grandma" Grandad
DAD(G2)奶奶(爸爸)Great Grandad奶奶
Great Grandad"爷爷
"奶奶
Me(Gen 1)"爷爷
"奶奶
MOM(G2)Great / Great Grandad(G5)
Granddad(妈妈)(G3)Great Grandad(G4)"奶奶
奶奶(妈妈)大奶奶" Grandad
Great Grandad奶奶
大奶奶"爷爷
"奶奶
"爷爷
"奶奶
我可以做表单布局,打印等,但无法设置查询以获得原始Gen 1的所有这些。
我能找到的任何帮助都表示赞赏。
Howdy,
I''ve been away from Access for a few years, just trying to get my legs back under me.
I have a challenge to create a relational database of horses. The primary hurdle I can''t get over is this:
Primary info, each record will have unique registration number (key), a field for sire (father) and dam (mother) for each horse. These fields will be horses also in the database.
I need to be able to query the pedigree(heritage if you will) back 5 generations. I''m stuck as to how to do that.
IE: Great/Great Grandad(G5)
Great Grandad (G4) " Grandma
Grandad(dads)(G3) Great Grandma " Grandad
DAD(G2) Grandma(dads) Great Grandad " Grandma
Great Grandad " Grandad
" Grandma
Me (Gen 1) " Grandad
" Grandma
MOM(G2) Great/Great Grandad(G5)
Granddad(moms)(G3) Great Grandad (G4) " Grandma
Grandma(moms) Great Grandma " Grandad
Great Grandad " Grandma
Great Grandma " Grandad
" Grandma
" Grandad
" Grandma
I can do the form layouts, prints, etc, but having trouble setting up the query to get all this for the original Gen 1.
Any assistance I can find is appreciated.
推荐答案
抱歉 - 我的布局没有按照我的计划进行。
>
基本上,我需要相当于一匹马的生成树,可以追溯到5代。
谢谢
Dan
Sorry - My layout didn''t work out the way I planned.
Basically, I need the equivalent of a geneology tree for one horse going back 5 generations.
Thanks
Dan
据我所知,你有一个表,其中两个外键设置为自己的主键。在查询中,您必须有三个表格实例。
tblHorses
tblHorses_1''第一个外键加入第一个实例的主键
tblHorses_2''第二个外键加入第一个实例的主键
这应该允许你查询所有后代
>
As i understand it you have a table with two foreign keys set to its own primary key. In a query you will have to have three instances of the table.
tblHorses
tblHorses_1 ''First foreign key joined to primary key of first instance
tblHorses_2 ''Second foreign key joined to primary key of first instance
This should allow you to query all decendants
你好,
我已经离开Access几年了,只是想让我的腿回到我的身下。
我对创建马的关系数据库有挑战。我无法克服的主要障碍是:
主要信息,每条记录都有唯一的注册号(密钥),父亲(父亲)和母亲(母亲)的字段)为每匹马。这些字段也将成为数据库中的马。
我需要能够查询5个世代的谱系(遗产,如果你愿意)。我被困在如何做到这一点。
IE:伟大/伟大的爷爷(G5)
Great Grandad(G4)"奶奶
Grandad(爸爸)(G3)Great grandma" Grandad
DAD(G2)奶奶(爸爸)Great Grandad奶奶
Great Grandad"爷爷
"奶奶
Me(Gen 1)"爷爷
"奶奶
MOM(G2)Great / Great Grandad(G5)
Granddad(妈妈)(G3)Great Grandad(G4)"奶奶
奶奶(妈妈)大奶奶" Grandad
Great Grandad奶奶
大奶奶"爷爷
"奶奶
"爷爷
"奶奶
我可以做表单布局,打印等,但无法设置查询以获得原始Gen 1的所有这些。
我能找到的任何帮助都表示赞赏。
Howdy,
I''ve been away from Access for a few years, just trying to get my legs back under me.
I have a challenge to create a relational database of horses. The primary hurdle I can''t get over is this:
Primary info, each record will have unique registration number (key), a field for sire (father) and dam (mother) for each horse. These fields will be horses also in the database.
I need to be able to query the pedigree(heritage if you will) back 5 generations. I''m stuck as to how to do that.
IE: Great/Great Grandad(G5)
Great Grandad (G4) " Grandma
Grandad(dads)(G3) Great Grandma " Grandad
DAD(G2) Grandma(dads) Great Grandad " Grandma
Great Grandad " Grandad
" Grandma
Me (Gen 1) " Grandad
" Grandma
MOM(G2) Great/Great Grandad(G5)
Granddad(moms)(G3) Great Grandad (G4) " Grandma
Grandma(moms) Great Grandma " Grandad
Great Grandad " Grandma
Great Grandma " Grandad
" Grandma
" Grandad
" Grandma
I can do the form layouts, prints, etc, but having trouble setting up the query to get all this for the original Gen 1.
Any assistance I can find is appreciated.
据我所知,你有一个表,其中两个外键设置为自己的主键。在查询中,您必须有三个表格实例。
tblHorses
tblHorses_1''第一个外键加入第一个实例的主键
tblHorses_2''第二个外键加入第一个实例的主键
这应该允许你查询所有后代
As i understand it you have a table with two foreign keys set to its own primary key. In a query you will have to have three instances of the table.
tblHorses
tblHorses_1 ''First foreign key joined to primary key of first instance
tblHorses_2 ''Second foreign key joined to primary key of first instance
This should allow you to query all decendants
谢谢 - 我会看看这对我是否有意义,我可以让它发挥作用。
Dan VW
Thanks - I''ll see if that makes sense to me and I can get it to work.
Dan VW
这篇关于注册数据库的谱系查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!