473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Order of the tables searched

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

Nov 13 '05 #1
0 914

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: One's Too Many | last post by:
Ran into a strange problem today: 8.1.7 on AIX 4.3.3 Database and applications had been working fine for two years and all of a sudden a couple of regularly-run queries are now no longer...
44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
7
by: Jean-Francois.Doyon | last post by:
Hello, I'm trying to retrieve a limited number of random rows, and order them by a column, and am not having any luck with that last part: SELECT * FROM tablename ORDER BY random(), id LIMIT...
4
by: Gobi | last post by:
Hello, I have a Database with lists of Clients in each. Every year a new tables is created with the naming convention "CloseYear" ie close1999, close2000 There are tables from this year back to...
8
by: kaosyeti | last post by:
i have a (hopefully) small problem. i have created a system where a user enters customer information into a table through a form. this table has no primary key. there are 9 fields on the form to...
3
by: MaRCeLO PeReiRA | last post by:
Hi guys, Is there a way I can separate things in PostgreSQL? Putting tables in a disk partition and indexes in another one????? Regards, MaRcELo PeReiRa PHP/SQL/PostgreSQL
2
by: Scamjunk | last post by:
I have been desperately looking for a treeview-type solution for my problem for the past three weeks and have been greatly unsuccessful. I am totally new to the world of XSLT and I *don't know*...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
2
by: melchior | last post by:
Hi, I have searched and searched without much luck. I feel like I am doing the right thing, just not getting the right result, so here goes. I have 2 tables. One has about 100,000 records...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.