davidnewbie
Registered User.
- Local time
- Today, 10:26
- Joined
- Oct 6, 2008
- Messages
- 13
Does anyone know if you can use the WHERE clause after a JOIN is done?
I have a join which gets what I need (basically getting the latest records out of a table "tblHistory"
----------------------
SELECT A.* FROM tblHistory AS A
INNER JOIN
(SELECT id, max([Entry Datime]) as maxEntryDatime FROM tblHistory WHERE HousingId='SJ RH1' GROUP BY id) AS B
ON (A.[Entry Datime] = B.maxEntryDatime) AND (A.id = B.id);
----------------------
Now, that I have the latest records I want to say WHERE anotherField='TRUE' to grab just specific records for my resultset...
I have a join which gets what I need (basically getting the latest records out of a table "tblHistory"
----------------------
SELECT A.* FROM tblHistory AS A
INNER JOIN
(SELECT id, max([Entry Datime]) as maxEntryDatime FROM tblHistory WHERE HousingId='SJ RH1' GROUP BY id) AS B
ON (A.[Entry Datime] = B.maxEntryDatime) AND (A.id = B.id);
----------------------
Now, that I have the latest records I want to say WHERE anotherField='TRUE' to grab just specific records for my resultset...