Hi All,
I have an issue that's driving me crazy because logically, to me anyway, this should work... Access 2002 doesn't see it that way :-(
My goal is this:
I have a parent table (IssueIncident) and a child table (IssueUpdate). I am making a summary type report that should display all issues from parent issues table, and with it only the latest corresponding update from the child table. If there are no updates, I would like to display the issue from the parent table anyway.
After checking several posts here I decided that I would be best creating more than one query for this. The first query (zTestLatestDate) will simply find the latest updates for me:
SELECT Max(tblIssueUpdate.UpdateDate) AS MaxOfUpdateDate, tblIssueIncident.MyIssueIncidentID
FROM tblIssueIncident LEFT JOIN tblIssueUpdate ON tblIssueIncident.MyIssueIncidentID = tblIssueUpdate.IssueIncidentID
GROUP BY tblIssueIncident.MyIssueIncidentID;
Now, this works. I get only the latest update AND because of the LEFT JOIN I get issues from parent table that have no child records. So far so good but here is where it gets wierd.
I just want to join this query with the rest of the data from the issue and update table for my report. For simplicity sake I am just going to talk about the update table below because if I get it going on that I should be good!
I created the following query to try and JOIN my zTestLatestDate query to the IssueUpdate table
SELECT <all fields from IssueUpdate - I wont list them>
FROM zTestLatestDate INNER JOIN tblIssueUpdate ON zTestLatestDate.MyIssueIncidentID = tblIssueUpdate.IssueIncidentID
WHERE (((tblIssueUpdate.UpdateDate)=[zTestLatestDate].[MaxOfUpdateDate]));
But this does not work. It will not display Issues from parent table without an update. In other words I've lost my LEFT JOIN. Note that I have tried the above query as a LEFT JOIN in itself and have played around with it quite a bit and cannot get the desired result.
Sorry if I've prattled on. It's hard to explain these things! I hope someone can see the error of my ways
I would appreciate any advice. Let me know if you want to take a peek at the DB.
Thank You!!
Arch
I have an issue that's driving me crazy because logically, to me anyway, this should work... Access 2002 doesn't see it that way :-(
My goal is this:
I have a parent table (IssueIncident) and a child table (IssueUpdate). I am making a summary type report that should display all issues from parent issues table, and with it only the latest corresponding update from the child table. If there are no updates, I would like to display the issue from the parent table anyway.
After checking several posts here I decided that I would be best creating more than one query for this. The first query (zTestLatestDate) will simply find the latest updates for me:
SELECT Max(tblIssueUpdate.UpdateDate) AS MaxOfUpdateDate, tblIssueIncident.MyIssueIncidentID
FROM tblIssueIncident LEFT JOIN tblIssueUpdate ON tblIssueIncident.MyIssueIncidentID = tblIssueUpdate.IssueIncidentID
GROUP BY tblIssueIncident.MyIssueIncidentID;
Now, this works. I get only the latest update AND because of the LEFT JOIN I get issues from parent table that have no child records. So far so good but here is where it gets wierd.
I just want to join this query with the rest of the data from the issue and update table for my report. For simplicity sake I am just going to talk about the update table below because if I get it going on that I should be good!
I created the following query to try and JOIN my zTestLatestDate query to the IssueUpdate table
SELECT <all fields from IssueUpdate - I wont list them>
FROM zTestLatestDate INNER JOIN tblIssueUpdate ON zTestLatestDate.MyIssueIncidentID = tblIssueUpdate.IssueIncidentID
WHERE (((tblIssueUpdate.UpdateDate)=[zTestLatestDate].[MaxOfUpdateDate]));
But this does not work. It will not display Issues from parent table without an update. In other words I've lost my LEFT JOIN. Note that I have tried the above query as a LEFT JOIN in itself and have played around with it quite a bit and cannot get the desired result.
Sorry if I've prattled on. It's hard to explain these things! I hope someone can see the error of my ways
I would appreciate any advice. Let me know if you want to take a peek at the DB.
Thank You!!
Arch