Hi,
I have 2 linked tables tblProjects and tblActions. They are linked on ProjectId. The records in tblActions contain a date. I want to get a list of all Projects with the lowest date and highest date.
I have the following SQL but the problem with aggregate functions is that NULL values are ignored, so the projects where no actions are defined do not appear in the list.
Does anyone have a solution?
SELECT tblProjects.ProjectId AS ProjectId, Name, ProjectManager, Min(Date) AS MinOfDate, Max(Date) AS MaxOfDate FROM tblProjects LEFT JOIN tblActions ON tblProjects.ProjectId = tblActions.ProjectId GROUP BY tblProjects.ProjectId, Name, ProjectManager
I have 2 linked tables tblProjects and tblActions. They are linked on ProjectId. The records in tblActions contain a date. I want to get a list of all Projects with the lowest date and highest date.
I have the following SQL but the problem with aggregate functions is that NULL values are ignored, so the projects where no actions are defined do not appear in the list.
Does anyone have a solution?
SELECT tblProjects.ProjectId AS ProjectId, Name, ProjectManager, Min(Date) AS MinOfDate, Max(Date) AS MaxOfDate FROM tblProjects LEFT JOIN tblActions ON tblProjects.ProjectId = tblActions.ProjectId GROUP BY tblProjects.ProjectId, Name, ProjectManager