B
brownti via AccessMonster.com
I started with Duane's crew rotation schedule and have modified it to show
only the current week using the SQL below. The problem i am running into is
that if StartDate is before monday of the current week or end date is after
friday of the current week, that information does not show up on the report.
How could adjust this SQL to break these entries up so that if the start date
is before monday, it would display it as a start on monday and the same thing
for end date? Thanks!
SELECT tblTrimmers.TrimmerID, [FirstName] & " " & [LastName] AS Name,
tblTrimmers.TrimmerColor, tblRotationII.UnitID, tblRotationII.StartDate,
tblRotationII.EndDate, [JobNumber] & " " & [UnitNumber] AS Unit
FROM tblJobInfo INNER JOIN (tblTrimmers INNER JOIN (tblRotationII INNER JOIN
tblUnitSelections ON tblRotationII.UnitID = tblUnitSelections.UnitID) ON
tblTrimmers.TrimmerID = tblRotationII.TrimmerID) ON tblJobInfo.JobID =
tblUnitSelections.JobID
WHERE (((tblRotationII.StartDate)>=Date()-Weekday(Date())+2) AND (
(tblRotationII.EndDate)<=Date()-Weekday(Date())+6));
only the current week using the SQL below. The problem i am running into is
that if StartDate is before monday of the current week or end date is after
friday of the current week, that information does not show up on the report.
How could adjust this SQL to break these entries up so that if the start date
is before monday, it would display it as a start on monday and the same thing
for end date? Thanks!
SELECT tblTrimmers.TrimmerID, [FirstName] & " " & [LastName] AS Name,
tblTrimmers.TrimmerColor, tblRotationII.UnitID, tblRotationII.StartDate,
tblRotationII.EndDate, [JobNumber] & " " & [UnitNumber] AS Unit
FROM tblJobInfo INNER JOIN (tblTrimmers INNER JOIN (tblRotationII INNER JOIN
tblUnitSelections ON tblRotationII.UnitID = tblUnitSelections.UnitID) ON
tblTrimmers.TrimmerID = tblRotationII.TrimmerID) ON tblJobInfo.JobID =
tblUnitSelections.JobID
WHERE (((tblRotationII.StartDate)>=Date()-Weekday(Date())+2) AND (
(tblRotationII.EndDate)<=Date()-Weekday(Date())+6));