A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

child link to itself



 
 
Thread Tools Display Modes
  #1  
Old August 15th, 2008, 05:35 PM posted to microsoft.public.access.tablesdbdesign
inungh
external usenet poster
 
Posts: 177
Default child link to itself

I have a child table which has composite key ID and CID which both
link to parent table like following.

I would like to know is it bizard design like this?

tblParent

ID long integer primary key
MyDate Date Time

tblChild

ID long integer primary key
CID long integer primary key
ChildField Text(50)


Data will be

Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008

Child table

ID CID ChildField
1 2 First time
1 3 Second time


Your information is great appreciated,

  #2  
Old August 15th, 2008, 05:45 PM posted to microsoft.public.access.tablesdbdesign
strive4peace
external usenet poster
 
Posts: 1,670
Default child link to itself

Consider doing this:

tblParent
- IDparent, autonumber

tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null

When a table is liked to itself, I like to use its primary key fieldname
with an underscore

When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name

~~~

it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




inungh wrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.

I would like to know is it bizard design like this?

tblParent

ID long integer primary key
MyDate Date Time

tblChild

ID long integer primary key
CID long integer primary key
ChildField Text(50)


Data will be

Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008

Child table

ID CID ChildField
1 2 First time
1 3 Second time


Your information is great appreciated,

  #3  
Old August 18th, 2008, 12:09 PM posted to microsoft.public.access.tablesdbdesign
inungh
external usenet poster
 
Posts: 177
Default child link to itself

On Aug 15, 12:45*pm, strive4peace wrote:
Consider doing this:

tblParent
- IDparent, autonumber

tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null

When a table is liked to itself, I like to use its primary key fieldname
with an underscore

When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name

~~~

it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP..com/strive4peace

* *
* * (: have an awesome day
* *



inungh wrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.


I would like to know is it bizard design like this?


tblParent


ID * * * * * * *long integer *primary key
MyDate * * *Date Time


tblChild


ID * * * * * * long integer * * primary key
CID * * * * * long integer * * primary key
ChildField *Text(50)


Data will be


Parent table
ID * * * * * * MyDate
1 * * * * * * 01/20/2008
2 * * * * * * 03/15/2007
3 * * * * * * 04/01/2008


Child table


ID * * *CID * *ChildField
1 * * * *2 * *First time
1 * * * *3 * *Second time


Your information is great appreciated,- Hide quoted text -


- Show quoted text -


Thanks for the information,

  #4  
Old August 18th, 2008, 02:03 PM posted to microsoft.public.access.tablesdbdesign
strive4peace
external usenet poster
 
Posts: 1,670
Default child link to itself

"Thanks for the information"

you're welcome happy to help

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




inungh wrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:

tblParent
- IDparent, autonumber

tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null

When a table is liked to itself, I like to use its primary key fieldname
with an underscore

When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name

~~~

it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*



inungh wrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID long integer primary key
MyDate Date Time
tblChild
ID long integer primary key
CID long integer primary key
ChildField Text(50)
Data will be
Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008
Child table
ID CID ChildField
1 2 First time
1 3 Second time
Your information is great appreciated,- Hide quoted text -

- Show quoted text -


Thanks for the information,

  #5  
Old August 19th, 2008, 07:16 PM posted to microsoft.public.access.tablesdbdesign
inungh
external usenet poster
 
Posts: 177
Default child link to itself

On Aug 18, 9:03*am, strive4peace wrote:
"Thanks for the information"

you're welcome *happy to help

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP..com/strive4peace

* *
* * (: have an awesome day
* *



inungh wrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:


tblParent
- IDparent, autonumber


tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null


When a table is liked to itself, I like to use its primary key fieldname
with an underscore


When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name


~~~


it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up


Warm Regards,
Crystal


remote programming and training


Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace


* *
* * (: have an awesome day
* *


inungh wrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID * * * * * * *long integer *primary key
MyDate * * *Date Time
tblChild
ID * * * * * * long integer * * primary key
CID * * * * * long integer * * primary key
ChildField *Text(50)
Data will be
Parent table
ID * * * * * * MyDate
1 * * * * * * 01/20/2008
2 * * * * * * 03/15/2007
3 * * * * * * 04/01/2008
Child table
ID * * *CID * *ChildField
1 * * * *2 * *First time
1 * * * *3 * *Second time
Your information is great appreciated,- Hide quoted text -
- Show quoted text -


Thanks for the information,- Hide quoted text -


- Show quoted text -


I had table to link to itself like supervisor links to employee table
itself. It is my first time that child links to its parent.

I have problem to find records which child does not exists.
Are there any specific way to find child link does not exist?

For exmaple,

Parent table have following data

ID
1
2
3
4

Child has following data

ID ChildID
1 2
1 4


Child ID link to Parent table ID.
Are there any way to find ID 3 in the parent table?

Your help is great appreciated,
  #6  
Old August 19th, 2008, 11:46 PM posted to microsoft.public.access.tablesdbdesign
strive4peace
external usenet poster
 
Posts: 1,670
Default child link to itself

"Are there any specific way to find child link does not exist?"

SELECT Parent.ID
FROM Parent LEFT JOIN Child On Parent.ID=Child.ID
WHERE Child.ID Is Null


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




inungh wrote:
On Aug 18, 9:03 am, strive4peace wrote:
"Thanks for the information"

you're welcome happy to help

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*



inungh wrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:
tblParent
- IDparent, autonumber
tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null
When a table is liked to itself, I like to use its primary key fieldname
with an underscore
When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name
~~~
it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
*
(: have an awesome day
*
inungh wrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID long integer primary key
MyDate Date Time
tblChild
ID long integer primary key
CID long integer primary key
ChildField Text(50)
Data will be
Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008
Child table
ID CID ChildField
1 2 First time
1 3 Second time
Your information is great appreciated,- Hide quoted text -
- Show quoted text -
Thanks for the information,- Hide quoted text -

- Show quoted text -


I had table to link to itself like supervisor links to employee table
itself. It is my first time that child links to its parent.

I have problem to find records which child does not exists.
Are there any specific way to find child link does not exist?

For exmaple,

Parent table have following data

ID
1
2
3
4

Child has following data

ID ChildID
1 2
1 4


Child ID link to Parent table ID.
Are there any way to find ID 3 in the parent table?

Your help is great appreciated,

  #7  
Old August 20th, 2008, 01:11 PM posted to microsoft.public.access.tablesdbdesign
inungh
external usenet poster
 
Posts: 177
Default child link to itself

On Aug 19, 6:46*pm, strive4peace wrote:
"Are there any specific way to find child link does not exist?"

SELECT Parent.ID
FROM Parent LEFT JOIN Child On Parent.ID=Child.ID
WHERE Child.ID Is Null

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP..com/strive4peace

* *
* * (: have an awesome day
* *



inunghwrote:
On Aug 18, 9:03 am, strive4peace wrote:
"Thanks for the information"


you're welcome *happy to help


Warm Regards,
Crystal


remote programming and training


Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace


* *
* * (: have an awesome day
* *


inunghwrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:
tblParent
- IDparent, autonumber
tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null
When a table is liked to itself, I like to use its primary key fieldname
with an underscore
When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name
~~~
it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
* *
* * (: have an awesome day
* *
inunghwrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID * * * * * * *long integer *primary key
MyDate * * *Date Time
tblChild
ID * * * * * * long integer * * primary key
CID * * * * * long integer * * primary key
ChildField *Text(50)
Data will be
Parent table
ID * * * * * * MyDate
1 * * * * * * 01/20/2008
2 * * * * * * 03/15/2007
3 * * * * * * 04/01/2008
Child table
ID * * *CID * *ChildField
1 * * * *2 * *First time
1 * * * *3 * *Second time
Your information is great appreciated,- Hide quoted text -
- Show quoted text -
Thanks for the information,- Hide quoted text -
- Show quoted text -


I had table to link to itself like supervisor links to employee table
itself. It is my first time that child links to its parent.


I have problem to find records which child does not exists.
Are there any specific way to find child link does not exist?


For exmaple,


Parent table have following data


ID
1
2
3
4


Child has following data


ID *ChildID
1 * * *2
1 * * *4


Child ID link to Parent table ID.
Are there any way to find ID 3 in the parent table?


Your help is great appreciated,- Hide quoted text -


- Show quoted text -


Thanks for helping,
I beleive my problem is the child links to parent.
Actually, Child is parent of parent table,
In this case , child is parent. am I right?

Thanks again,

  #8  
Old August 20th, 2008, 02:04 PM posted to microsoft.public.access.tablesdbdesign
inungh
external usenet poster
 
Posts: 177
Default child link to itself

On Aug 20, 8:11*am, inungh wrote:
On Aug 19, 6:46*pm, strive4peace wrote:





"Are there any specific way to find child link does not exist?"


SELECT Parent.ID
FROM Parent LEFT JOIN Child On Parent.ID=Child.ID
WHERE Child.ID Is Null


Warm Regards,
Crystal


remote programming and training


Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace


* *
* * (: have an awesome day
* *


inunghwrote:
On Aug 18, 9:03 am, strive4peace wrote:
"Thanks for the information"


you're welcome *happy to help


Warm Regards,
Crystal


remote programming and training


Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace


* *
* * (: have an awesome day
* *


inunghwrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:
tblParent
- IDparent, autonumber
tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null
When a table is liked to itself, I like to use its primary key fieldname
with an underscore
When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name
~~~
it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
* *
* * (: have an awesome day
* *
inunghwrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID * * * * * * *long integer *primary key
MyDate * * *Date Time
tblChild
ID * * * * * * long integer * * primary key
CID * * * * * long integer * * primary key
ChildField *Text(50)
Data will be
Parent table
ID * * * * * * MyDate
1 * * * * * * 01/20/2008
2 * * * * * * 03/15/2007
3 * * * * * * 04/01/2008
Child table
ID * * *CID * *ChildField
1 * * * *2 * *First time
1 * * * *3 * *Second time
Your information is great appreciated,- Hide quoted text -
- Show quoted text -
Thanks for the information,- Hide quoted text -
- Show quoted text -


I had table to link to itself like supervisor links to employee table
itself. It is my first time that child links to its parent.


I have problem to find records which child does not exists.
Are there any specific way to find child link does not exist?


For exmaple,


Parent table have following data


ID
1
2
3
4


Child has following data


ID *ChildID
1 * * *2
1 * * *4


Child ID link to Parent table ID.
Are there any way to find ID 3 in the parent table?


Your help is great appreciated,- Hide quoted text -


- Show quoted text -


Thanks for helping,
I beleive my problem is the child links to parent.
Actually, Child is parent of parent table,
In this case , child is parent. am I right?

Thanks again,- Hide quoted text -

- Show quoted text -


Thanks I got this works.
in this case, I have my child as parent then it works now.
Thanks again,
  #9  
Old August 22nd, 2008, 01:36 AM posted to microsoft.public.access.tablesdbdesign
strive4peace
external usenet poster
 
Posts: 1,670
Default child link to itself

you're welcome happy to help


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




inungh wrote:
On Aug 20, 8:11 am, inungh wrote:
On Aug 19, 6:46 pm, strive4peace wrote:





"Are there any specific way to find child link does not exist?"
SELECT Parent.ID
FROM Parent LEFT JOIN Child On Parent.ID=Child.ID
WHERE Child.ID Is Null
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
*
(: have an awesome day
*
inunghwrote:
On Aug 18, 9:03 am, strive4peace wrote:
"Thanks for the information"
you're welcome happy to help
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
*
(: have an awesome day
*
inunghwrote:
On Aug 15, 12:45 pm, strive4peace wrote:
Consider doing this:
tblParent
- IDparent, autonumber
tblChild
- CID, autonumber
- IDparent, long, DefaultValue -- null
- CID_, long, DefaultValue -- null
When a table is liked to itself, I like to use its primary key fieldname
with an underscore
When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name
~~~
it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP.com/strive4peace
*
(: have an awesome day
*
inunghwrote:
I have a child table which has composite key ID and CID which both
link to parent table like following.
I would like to know is it bizard design like this?
tblParent
ID long integer primary key
MyDate Date Time
tblChild
ID long integer primary key
CID long integer primary key
ChildField Text(50)
Data will be
Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008
Child table
ID CID ChildField
1 2 First time
1 3 Second time
Your information is great appreciated,- Hide quoted text -
- Show quoted text -
Thanks for the information,- Hide quoted text -
- Show quoted text -
I had table to link to itself like supervisor links to employee table
itself. It is my first time that child links to its parent.
I have problem to find records which child does not exists.
Are there any specific way to find child link does not exist?
For exmaple,
Parent table have following data
ID
1
2
3
4
Child has following data
ID ChildID
1 2
1 4
Child ID link to Parent table ID.
Are there any way to find ID 3 in the parent table?
Your help is great appreciated,- Hide quoted text -
- Show quoted text -

Thanks for helping,
I beleive my problem is the child links to parent.
Actually, Child is parent of parent table,
In this case , child is parent. am I right?

Thanks again,- Hide quoted text -

- Show quoted text -


Thanks I got this works.
in this case, I have my child as parent then it works now.
Thanks again,

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.