By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Order of the tables searched

P: n/a
I am trying to create an .asp page which can display my school's list
of classes for each student.
I have a database with two tables. One contains a list of all students
and which classes they have. The other contains the data for the rooms,
teachers, times and the names of the various classes.
I want to search through the second table, finding the entries which
occur at a specific time (called wintp.dag (day of the week) and
wintp.modul (time of day) in my table), these entries should then be
compared with students having the right names (GAS.fornavne) to see if
there is a match in classes for the particular student at that
particular time and then return that walue to me (along with the room
and teacher, but that I know how to do).

Access 2000 has created the following SQL statement:
wintp.titel is the name of the classes and GAS.Hold<n> is the names of
the classes for each student, whose name is in GAS.Fornavne.
SELECT wintp.titel, wintp.laerer, wintp.lokale, wintp.dag, wintp.modul
FROM GAS, wintp
WHERE (((wintp.titel)=[GAS].[Hold1] Or (wintp.titel)=[GAS].[Hold2] Or
(wintp.titel)=[GAS].[Hold3] Or (wintp.titel)=[GAS].[Hold4] Or
(wintp.titel)=[GAS].[Hold5] Or (wintp.titel)=[GAS].[Hold6] Or
(wintp.titel)=[GAS].[Hold7] Or (wintp.titel)=[GAS].[Hold8] Or
(wintp.titel)=[GAS].[Hold9] Or (wintp.titel)=[GAS].[Hold10] Or
(wintp.titel)=[GAS].[Hold11] Or (wintp.titel)=[GAS].[Hold12]) AND
((wintp.dag)="manu") AND ((wintp.modul)=1) AND

But when I try using it in access I can see that what it actualy does
is only to find the first match in classnames
(wintp.titel=[GAS].[Hold1]) for each student and then find out at which
times these classes are. So as far as I can see I have to search the
other way round (going through wintp first then GAS) but I don't know
how to do that.

This is an automatic signature of MesNews.
Site :

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.