473,386 Members | 1,819 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,386 software developers and data experts.

History query question

1
I tried to explain the best I can but it is very difficult to do. Here it goes.

I have three history tables. Teacher, student and school. School and teacher, and school and student are linked together.
I need to make a query that makes in one query a temporary table that list all the students that had a teacher change at some given date in the past.

For example:
If I give the query the following date 01/01/2007 it needs to give me all the student that had a teacher change.
But the table history teacher doesn't have a link with the history student table. So I need to search the history school table to find the student id.

There are three things that can happen:
1st: I give the date 01/01/2007 in so I need to look for this date in the history teacher table. If the school id is not null the teacher hasn't been deleted. Than I need to now if it change from school. I need to do that by searching the change that happened before the date I gave up. If the school id's are identical the teacher is still at the same school. So I only need to look for the first teacher id in the history school table to get the student id.

2nd: If the school id did change I have to look for the first and second teacher id in the history school table to get the student id.

3rd: If the school id is null I need to look for the second teacher id in the history school table.

Sorry for my bad English

Thanks in advance

Nyh
Aug 31 '07 #1
0 1243

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: vbfoobar | last post by:
Hello, My question is: Is there an easy mean to make Python "command history" persistent across interpreter invokations? PS: In the case the question above is not clear, I rephrase it below...
3
by: Phil Sherman | last post by:
UDB LUW (Windows) 8.1 FP9a I issued a PRUNE HISTORY 20050819 AND DELETE and was surprised to see that the archived log files were not physically deleted. The history record of the 20050818...
7
by: RLN | last post by:
Re: Access 2000 I have three history tables. Each table contains 3 years worth of data. All three tables have a date field in them (and autonum field). Each table has the potential to contain...
1
by: Gomez | last post by:
I have set up two tables ****current and ****history. The history table contains all the fields which I want to track changes on. The current table contains just the most recent information from...
1
by: rxfrenc | last post by:
Hello, I am trying to create a report that displays balance impacting inventory transactions. I can easily pull the current on-hand balance in one query and the transaction history in another...
8
by: Alex D. | last post by:
does any body knows how to open a new IE window and close the favorites tab and history tab (if tabs enabled)? problem is that when opening new windows(pop-ups) with absolute size and the user has...
2
osward
by: osward | last post by:
Hello everyone, Background: cat table - holds the event details and has a unique "eid" field user and user_temp table has the "eid" "user_id" and other fields, they are almost identical, the...
11
by: unionhorse | last post by:
Hello, We use an access database for the membership administration of thousands of musicians. Membership status varies from "active" to "suspended" to "expelled". Musicians go in and out of...
0
by: lemnitzer | last post by:
Full Article: http://iamthewitness.com/FreedmanFactsAreFacts.html <-------- KEY DOCUMENT Steamy Excerpts: Will you be patient with me while I review here as briefly as I can the history of...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.