My MS Access 013 database had a table that records hours worked on specific projects in [Design Hours] and cross-references with a table of information about our people in [People], who manages whom in [Managers], and information about each project in [Projects]. (This description simplified and serial numbers scraped off for this public posting.)
We have a report that accepts a date interval from a very simple form, then runs a query that should return all records of hours recorded as having been worked in that date interval, with each row of the query results returning the hours, name of the person working, his/her manager's name, and how the hours for that item are divided among out clients. Here's an anonymized query result, for your reference:
Person Project WorkDate Hours PersonID Managers_ID Managers_FirstName
Doe Projectname 9/30/2015 8 54 4 Jeff
The weird behavior I'm seeing is that if there are records of the person having worked on the same project twice on the same day, AND if that is the last date of the interval (or possibly the month, the intervals are always monthly), NEITHER record appears in the query result, and thus neither appears in the report. How can I adjust the query to include multiple records on the same day that match the date interval?
I include the SQL of the query for reference. It's much more complex than implied above, partly because it was done by three inexperienced developers working in semi-coordination over a period of years. My apologies for the messiness.
SELECT [Design Hours TABLE].UniqueID, [Design Hours TABLE].Person, [Design Hours TABLE].Project, [Design Hours TABLE].WorkDate, [Design Hours TABLE].Hours, Managers.PersonID, Managers.ID AS Managers_ID, Managers.FirstName AS Managers_FirstName, Managers.LastName AS Managers_LastName, Managers.[NE-Sub], Managers.[DNY-Sub], Managers.Jurisdiction, Managers.Business, Managers.Operations, Managers.Client, Managers.Active AS Managers_Active, Managers.Phone, People.ID AS People_ID, People.FirstName AS People_FirstName, People.LastName AS People_LastName, People.Manager, People.IsInstructor, People.IsDesigner, People.Active AS People_Active, People.ActiveDirectoryName, [Project Request Log TABLE].[LI-Gas], [Project Request Log TABLE].[NYC-Gas], [Project Request Log TABLE].[DNY-Gas], [Project Request Log TABLE].[UNY-Gas], [Project Request Log TABLE].[NE-Gas], [Project Request Log TABLE].[LI-CMS], [Project Request Log TABLE].[NYC-CMS], [Project Request Log TABLE].[DNY-CMS], [Project Request Log TABLE].[UNY-CMS], [Project Request Log TABLE].[NE-CMS], [Project Request Log TABLE].LIPA, [Project Request Log TABLE].[UNY-Dist], [Project Request Log TABLE].[NE-Dist], [Project Request Log TABLE].[UNY-PTO], [Project Request Log TABLE].[NE-PTO], [Project Request Log TABLE].[UNY-PMCC], [Project Request Log TABLE].[NE-PMCC], [Project Request Log TABLE].Powerplant, [Project Request Log TABLE].Other, [Project Request Log TABLE].ProjectName, People.FirstName, People.LastName, [Design Hours TABLE].WorkType, [Project Request Log TABLE].SpecialProject, [Design Hours TABLE].UniqueID, *
FROM [Project Request Log TABLE] INNER JOIN ((Managers INNER JOIN People ON Managers.ID = People.Manager) INNER JOIN [Design Hours TABLE] ON People.ID = [Design Hours TABLE].Person) ON [Project Request Log TABLE].ProjectID = [Design Hours TABLE].Project
WHERE ((([Design Hours TABLE].WorkDate)<=[Forms]![frmSelectDateRangeOnly]![EndDate] And ([Design Hours TABLE].WorkDate)=[Forms]![frmSelectDateRangeOnly]![StartDate]) AND (([Design Hours TABLE].WorkType)="Design") AND (([Project Request Log TABLE].SpecialProject)=False));
Thanks in advance for any help.