MS Access Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access query that finds start dates and end dates for phases of a project. Because there are multiple phases, there are multiple records for a project. I want to know what the number of days is between the end date of the last phase (record) and the start date of the first phase (record).
 
I have an Access query that finds start dates and end dates for phases of
a project. Because there are multiple phases, there are multiple records for
a project. I want to know what the number of days is between the end date of
the last phase (record) and the start date of the first phase (record).

You could create a group query such as
SELECT ProjectID, Min(StartDate) As MinStartDate , Max(EndDate) As
MaxEndDate
FROM MyProjectTable
GROUP BY ProjectID

You could then create a second query from the first
SELECT ProjectID, DateDiff('d', MinStartDate, MaxEndDate) As ProjectDays
FROM MyProjectGroupedQuery

Cheers,
Peter
 
Thanks, that was a good idea!

Peter Hoyle said:
a project. Because there are multiple phases, there are multiple records for
a project. I want to know what the number of days is between the end date of
the last phase (record) and the start date of the first phase (record).

You could create a group query such as
SELECT ProjectID, Min(StartDate) As MinStartDate , Max(EndDate) As
MaxEndDate
FROM MyProjectTable
GROUP BY ProjectID

You could then create a second query from the first
SELECT ProjectID, DateDiff('d', MinStartDate, MaxEndDate) As ProjectDays
FROM MyProjectGroupedQuery

Cheers,
Peter
 
Back
Top