Basic query but filtered from a related tables value...?

zozew

Registered User.
Local time
Tomorrow, 05:56
Joined
Nov 18, 2010
Messages
199
I have another post about another query question but same db...this is another Question :o

Base:

3 tables linked like this:

Data Table 1 (tblInmatesProfile):
InmateID, Name, etc

Data Table 2 (tblInmateCases):
CaseID, InmateID, Branch, Crime, Etc

Data Table 3 (tblInmateHearings)
CaseID, HearingID, Hearings

Question
How would i filter the first table's data on the third tables Hearings field?

So i could choose a date and all records in the first table that has a record with that date (in the related table 3) would display?
 
The SQL for the query would look something along the lines of;
Code:
SELECT tblInmateHearings.HearingDate, tblInmatesProfile.InmateName
FROM (tblInmateHearings INNER JOIN tblInmateCases ON tblInmateHearings.CaseID = tblInmateCases.CaseID) INNER JOIN tblInmatesProfile ON tblInmateCases.InmateID = tblInmatesProfile.InmateID
WHERE (((tblInmateHearings.HearingDate) Between #1/30/2010# And #2/10/2010#));
 
haha! It works like a charm...Thanks a million im starting to understand how you relate tables now in SQL queries.

Thx again
 

Users who are viewing this thread

Back
Top Bottom