PC Review


Reply
Thread Tools Rate Thread

Combine records in a single record

 
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      23rd Jul 2007
Dear friends,

I have two tables, e.g. Table1 (NumberOfPlot - Primary key)

Table2 (NumberOfPlot - foreign key, Species), which are related as One to
Many.

I need to create a query (?) to show in a single record the NumberOfPlot and
only the first 3 related records (species) in the following format, e.g.

ColumnA:121 (which is the plot number)
ColumnB: Pine, PineB, PineN (the first 3 related records of that plot)

Thanking you in advance

GeorgeCY
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      23rd Jul 2007
You will need to write a function to concatenate the values from the TOP 3
related records.

Here's a starting point:
Return a concatenated list of sub-record values
at:
http://www.mvps.org/access/modules/mdl0004.htm

You will need to modify it so the SQL statement selects just the TOP 3.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"George" <(E-Mail Removed)> wrote in message
news:8F7B19B4-50C5-489C-A132-(E-Mail Removed)...
> Dear friends,
>
> I have two tables, e.g. Table1 (NumberOfPlot - Primary key)
>
> Table2 (NumberOfPlot - foreign key, Species), which are related as One to
> Many.
>
> I need to create a query (?) to show in a single record the NumberOfPlot
> and
> only the first 3 related records (species) in the following format, e.g.
>
> ColumnA:121 (which is the plot number)
> ColumnB: Pine, PineB, PineN (the first 3 related records of that plot)
>
> Thanking you in advance
>
> GeorgeCY


 
Reply With Quote
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      25th Jul 2007
Dear Allen, Thanks a lot for the reply,

I have made some modifications on the structure of mmy database and I cannot
make this task. Here is the new layout of tables:

Tbl_CompartmentsAndPolygons: ForestID, CompNo and PolygonNo are primary keys.

Tbl_MainSpecies: ForestID, CompNo and PolygonNo and SpeciesID are primary
keys.

I would appreciate a lot if you could help me to use the given module in
order to achieve my task.

Thanks again,

GeorgeCY


Ο χρήστης "Allen Browne" *γγραψε:

> You will need to write a function to concatenate the values from the TOP 3
> related records.
>
> Here's a starting point:
> Return a concatenated list of sub-record values
> at:
> http://www.mvps.org/access/modules/mdl0004.htm
>
> You will need to modify it so the SQL statement selects just the TOP 3.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "George" <(E-Mail Removed)> wrote in message
> news:8F7B19B4-50C5-489C-A132-(E-Mail Removed)...
> > Dear friends,
> >
> > I have two tables, e.g. Table1 (NumberOfPlot - Primary key)
> >
> > Table2 (NumberOfPlot - foreign key, Species), which are related as One to
> > Many.
> >
> > I need to create a query (?) to show in a single record the NumberOfPlot
> > and
> > only the first 3 related records (species) in the following format, e.g.
> >
> > ColumnA:121 (which is the plot number)
> > ColumnB: Pine, PineB, PineN (the first 3 related records of that plot)
> >
> > Thanking you in advance
> >
> > GeorgeCY

>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      27th Jul 2007
Sorry George: I'm down with the 'flu at present, not able to think straight.

Perhaps someone else can make a suggestion.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"George" <(E-Mail Removed)> wrote in message
news:4600814F-CA20-4849-95B8-(E-Mail Removed)...
> Dear Allen, Thanks a lot for the reply,
>
> I have made some modifications on the structure of mmy database and I
> cannot
> make this task. Here is the new layout of tables:
>
> Tbl_CompartmentsAndPolygons: ForestID, CompNo and PolygonNo are primary
> keys.
>
> Tbl_MainSpecies: ForestID, CompNo and PolygonNo and SpeciesID are primary
> keys.
>
> I would appreciate a lot if you could help me to use the given module in
> order to achieve my task.
>
> Thanks again,
>
> GeorgeCY
>
>
> Ο χρήστης "Allen Browne" *γγραψε:
>
>> You will need to write a function to concatenate the values from the TOP
>> 3
>> related records.
>>
>> Here's a starting point:
>> Return a concatenated list of sub-record values
>> at:
>> http://www.mvps.org/access/modules/mdl0004.htm
>>
>> You will need to modify it so the SQL statement selects just the TOP 3.
>>
>> "George" <(E-Mail Removed)> wrote in message
>> news:8F7B19B4-50C5-489C-A132-(E-Mail Removed)...
>> > Dear friends,
>> >
>> > I have two tables, e.g. Table1 (NumberOfPlot - Primary key)
>> >
>> > Table2 (NumberOfPlot - foreign key, Species), which are related as One
>> > to
>> > Many.
>> >
>> > I need to create a query (?) to show in a single record the
>> > NumberOfPlot
>> > and
>> > only the first 3 related records (species) in the following format,
>> > e.g.
>> >
>> > ColumnA:121 (which is the plot number)
>> > ColumnB: Pine, PineB, PineN (the first 3 related records of that plot)


 
Reply With Quote
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      30th Jul 2007
Get well soon dear friend.

Ο χρήστης "Allen Browne" *γγραψε:

> Sorry George: I'm down with the 'flu at present, not able to think straight.
>
> Perhaps someone else can make a suggestion.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "George" <(E-Mail Removed)> wrote in message
> news:4600814F-CA20-4849-95B8-(E-Mail Removed)...
> > Dear Allen, Thanks a lot for the reply,
> >
> > I have made some modifications on the structure of mmy database and I
> > cannot
> > make this task. Here is the new layout of tables:
> >
> > Tbl_CompartmentsAndPolygons: ForestID, CompNo and PolygonNo are primary
> > keys.
> >
> > Tbl_MainSpecies: ForestID, CompNo and PolygonNo and SpeciesID are primary
> > keys.
> >
> > I would appreciate a lot if you could help me to use the given module in
> > order to achieve my task.
> >
> > Thanks again,
> >
> > GeorgeCY
> >
> >
> > Ο χρήστης "Allen Browne" *γγραψε:
> >
> >> You will need to write a function to concatenate the values from the TOP
> >> 3
> >> related records.
> >>
> >> Here's a starting point:
> >> Return a concatenated list of sub-record values
> >> at:
> >> http://www.mvps.org/access/modules/mdl0004.htm
> >>
> >> You will need to modify it so the SQL statement selects just the TOP 3.
> >>
> >> "George" <(E-Mail Removed)> wrote in message
> >> news:8F7B19B4-50C5-489C-A132-(E-Mail Removed)...
> >> > Dear friends,
> >> >
> >> > I have two tables, e.g. Table1 (NumberOfPlot - Primary key)
> >> >
> >> > Table2 (NumberOfPlot - foreign key, Species), which are related as One
> >> > to
> >> > Many.
> >> >
> >> > I need to create a query (?) to show in a single record the
> >> > NumberOfPlot
> >> > and
> >> > only the first 3 related records (species) in the following format,
> >> > e.g.
> >> >
> >> > ColumnA:121 (which is the plot number)
> >> > ColumnB: Pine, PineB, PineN (the first 3 related records of that plot)

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I combine multiple records for a single item? =?Utf-8?B?RHJTdG9uZTk4?= Microsoft Excel Misc 1 30th Apr 2007 11:22 PM
How do I combine multiple records for a single item? =?Utf-8?B?RHJTdG9uZTk4?= Microsoft Excel Misc 1 30th Apr 2007 10:24 PM
How to Combine Multiple Records into a Single Record Adding the Quantity Values of Same Fields Ken Microsoft Access Queries 4 17th Aug 2006 03:21 AM
Combine multiple records for a single date into 1 record =?Utf-8?B?QWRhbQ==?= Microsoft Access Queries 4 15th May 2006 04:25 AM
Combine records with a common field into one single record =?Utf-8?B?S3VydCBQ?= Microsoft Access 2 18th Oct 2003 03:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 PM.