Hi,
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
((GAS.Fornavne)="Peter"));
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.
Regards
Jonas
--
This is an automatic signature of MesNews.
Site : http://mesnews.no-ip.com