Thanx again, Jeanette.
Every SatsangClassInaugurated has some members designated as Arahatas. So
There is the SatsangClassInaugurated table (which takes details of the
meeting time, venue, day of the week or month etc) and then an associated
SatsangClassArahatas table (joined through the InaugurationID field) that
takes the assigned leaders or Arahatas. These leaders are numbers in the
Membership table, so the SatsangClassArahatas table is related to the
Membership table.
4 Records of the SatsangClassInaugurated look like this:
InaugurationID Zone SatsangName Venue MeetingDay MeetingTime CurrentDiscourse Book LastInauguration PostedBy Officiator
1 AMUWO ODOFIN AMUWO SATSANG 1 5TH AVENUE FESTAC 2ND SUNDAY 5:00 PM THE ECK
SATSANG I 09-Dec-2007 AJAO, RAFIU OLUGBENGA NWAGHODOH, OKAFOR JOHN ANIEMEKE
2 AMUWO ODOFIN AMUWO SATSANG 2 C CLOSE, 207 RD, FESTAC 2ND SUNDAY 4:00
PM THE ECK SATSANG III 09-Dec-2007 AJAO, RAFIU OLUGBENGA NWAGHODOH, OKAFOR
JOHN ANIEMEKE
3 AMUWO ODOFIN AMUWO SATSANG 4 ABULE ADO 2ND SUNDAY 10:30 AM ECK DREAM
I 09-Dec-2007 AJAO, RAFIU OLUGBENGA NWAGHODOH, OKAFOR JOHN ANIEMEKE
4 AMUWO ODOFIN AMUWO SATSANG 6 ABULE ADO 2ND SUNDAY 10:30 AM LETTERS OF
LIGHT AND SIOUND II 09-Dec-2007 AJAO, RAFIU OLUGBENGA NWAGHODOH, OKAFOR JOHN
ANIEMEKE
4 records of the SatsangClassArahatas look like this:
ArahataID InaugurationID Arahata
1 1 FAGBEMI, AYODELE OMOYIOLA
2 1 AKO, PAUL
3 2 NWAGHODOH, OKAFOR JOHN ANIEMEKE
4 3 BELLO, MUYIDEEN
The Membership table is quite large but a few rocrds look like this:
SerialNumber Zone Surname Firstnames ID# YearOfReg LastInitiation CurrentLevel ExpiryDate SubZone Sex DOB Status OfficeAddress HomeAddress PostalAddress E-mail OfficeTelephone HomeTelephone GSM Post Active PostedBy
6 AMUWO ODOFIN ADEPOJU GABRIEL
ADEYINKA 2154522 3 05-Apr-2001 FESTAC M Adult HOUSE 13, E CLOSE, 5TH
AVENUE FESTAC P. O. BOX 3896 FESTAC (e-mail address removed) 881304 ACTIVE
7 AMUWO ODOFIN ADEPOJU ADEYINKA
GABRIEL 2154522 3 05-Apr-2001 FESTAC M Adult HOUSE 13, E CLOSE, 5TH
AVENUE, FESTAC P. O. BOX 3896 FESTAC (e-mail address removed) 881304 ACTIVE
8 AMUWO ODOFIN AJAO RAFIU OLUGBENGA 2539754 3 03-Dec-2005 MAZAMAZA F 03
May Adult 41 OLD OJO RD, MAZAMAZA. 41 OLD OJO ROAD, MAZAMAZA P. O. BOX 5211,
FESTAC. OR P. O. BOX 5321, LAGOS. (e-mail address removed) 01.8792623 08023958108
LOCAL DIRECTOR
ACTIVE AJAO, RAFIU OLUGBENGA
9 AMUWO
ODOFIN AKERELE THERESA 2206500 2 29-Sep-2001 FESTAC F Adult ARAHATA
ACTIVE
The SatsangClassArahatas table is related to the Membership table via the
SerialNumber field.
All the forms work well; the SatsangClassInaugurated form has the
SatsangClassArahatas form as a subform. A SatsangClassInaugurated must have
at least one leader or Arahata, and not more than 4.
The problem I had arose when I tried to create a form to capture the
essentials of each SatsangClassInaugurated. In the query I was building, I
wanted to see the Arahatas associated with each SatsangClassInaugurated
displayed in separate fields. That was when I found that I could use the
domain aggregate function to see the the first or last record of the
associated SatsangClassArahatas. But then what do I use to display the second
or third, since there is no function like DSecond or DThird?
I usually use such a query and a form based on it to present a simple view
that allows me to filter the records anyway I like, insted of having to
construct many reports.
I hope I have given you a fair idea of the problem I had.
--
Glint
Jeanette Cunningham said:
Glint,
We will not use DFirst and DLast, but do it completely differently, more
like Ken's suggestion.
There is not any magic formula to give the result you want.
It is a process of building queries until we get the result that suits this
unique situation.
From your post I can see 3 tables:
SatsangClassInaugurated
SatsangClassArahatas
Membership
I created tables Membership and StasangClassArahatas
I made the query vArahatas and it looked like this:
InaugurationID Arahta
1 LastA aa
2 LastB bb
3 LastC cc
4 LastD dd
I am a bit lost figuring out which bit of the query refers to groups of
students, which bit refers to leaders, please clarify for me.
Please post quite a few rows from your query vArahatas.
Please also post a sample of how you want the final result to look.
How does the table SatsangClassInaugurated fit with the other 2 tables?
Jeanette Cunningham
Glint said:
Thanks, Jeanette.
I did not mean that the solution was simple, but that stating the problem
looked so. Here is the vClassArahatas query I was building:
SELECT SatsangClassInaugurated.*,
DFirst("[Arahata]","vArahatas","[InaugurationID]=" & [InaugurationID]) AS
ArahataI, IIf(DCount("*","SatsangClassArahatas","[InaugurationID]=" &
[InaugurationID])=1,Null,DLast("[Arahata]","vArahatas","[InaugurationID]="
&
[InaugurationID])) AS ArahataII
FROM SatsangClassInaugurated;
It has InaugurationID (primary) field among others.
The vArahatas query is as follows:
SELECT SatsangClassArahatas.InaugurationID, [Surname] & ", " &
[Firstnames]
AS Arahata
FROM Membership INNER JOIN SatsangClassArahatas ON Membership.SerialNumber
=
SatsangClassArahatas.Arahata;
They work very well. The problem I have is how to include a second or a
third Arahata as Arahata2 or Arahata3 in my vClassArahatas query in a
simple
manner similar to using the domain aggregate DFirst or DLast functions.
This
is because I want to display them in a form based on the query.
I sincerely look forward to any help.
--
Glint
Jeanette Cunningham said:
Glint,
if it were that simple, you wouldn't be asking on this newsgroup.
We will need the details of your table - the fields and a sample few rows
(change the data to protect privacy) of your table.
Jeanette Cunningham
Hi Jeanette,
The problem is as simple as it sounds: there are four or more records
in a
table. I want the names in those records selected into fields in my new
query. I can use DFirst aggregate function to get the first name, and
DLast
function to retrieve the last name. So far so good. The problem is what
to
use in my query to retrieve names other than first and last.
Please suggest a formula I can use in my query, assuming of course that
the
original table or recordset has been sorted in a particular order.
--
Glint
:
Hi Glint,
there are many answers on this newsgroup that show you how to count
and
rank
in a query.
Sounds as though this is what you want to.
Jeanette Cunningham
Hi Guys,
I like the domain aggregate function DFirst, DLast, DLookup etc. But
how
do
I select, say, the 17th record of a table or query when I have no
idea
what
the record contains? For example, if I know for certain that a query
returns
5 records, how do I select the second or the third ot fourth?