SELECT
pt.projectID,
p.name,
ptype.projectType,
p.actualEndDate,
pt.taskID,
t.subject,
t.dueDate,
t.percentComplete,
s.statusType,
c.categoryType,
datediff(DAY,getdate(),t.dueDate) As DaysLeft
FROM
ProjectTasks pt
INNER JOIN Project p
ON pt.projectID = p.projectID
INNER JOIN Task t
ON pt.taskID = t.taskID
INNER JOIN ProjectType ptype
ON ptype.projectTypeID = p.projectTypeID
INNER JOIN Status s
ON s.statusID = t.statusID
INNER JOIN Category c
ON c.categoryID = t.categoryID
WHERE datediff(DAY,getdate(),t.dueDate)= -7;
|