J
JBG
Below is a query I executed and the results was 181 records.
The purpose of the first query is to actually extract all timesheet line
records approved for timesheet class type=0 (tasks related to project plans)
and the timesheet being approved (status=3) for January 2008.
The purpose of the second query is to actually link the timesheet_lines
results with the tasks table to enable me in retrieving more information
about the specific tasks that a timesheet was linked to.
This gives me the impression that there is actually tasks in the timesheet
lines table with a specific task_uid, and the corresponding task_uid in the
tasks table does not exist. Any help on this would be appreciated.
SELECT distinct b.TS_LINE_CACHED_PROJ_NAME AS
view_ts_proj_noaxapta_projectname,
b.TS_LINE_CACHED_ASSIGN_NAME AS view_ts_proj_noaxapta_taskname
FROM dbo.MSP_TIMESHEETS AS a INNER JOIN
dbo.MSP_TIMESHEET_LINES AS b ON a.TS_UID = b.TS_UID INNER JOIN
dbo.MSP_TIMESHEET_CLASSES AS c ON b.TS_LINE_CLASS_UID =
c.TS_LINE_CLASS_UID INNER JOIN
dbo.MSP_TIMESHEET_ACTUALS AS d ON b.TS_LINE_UID = d.TS_LINE_UID
INNER JOIN
dbo.MSP_RESOURCES AS e ON a.RES_UID = e.RES_UID
WHERE (c.TS_LINE_CLASS_TYPE = 0) AND
(a.TS_STATUS_ENUM = 3) AND
(d.TS_ACT_VALUE + d.TS_ACT_NON_BILLABLE_VALUE > 0) AND
YEAR(d.TS_ACT_START_DATE) = 2008 AND
MOnth(d.TS_ACT_START_DATE) = 1
except
SELECT distinct b.TS_LINE_CACHED_PROJ_NAME AS
view_ts_proj_noaxapta_projectname,
b.TS_LINE_CACHED_ASSIGN_NAME AS view_ts_proj_noaxapta_taskname
FROM dbo.MSP_TIMESHEETS AS a INNER JOIN
dbo.MSP_TIMESHEET_LINES AS b ON a.TS_UID = b.TS_UID INNER JOIN
dbo.MSP_TIMESHEET_CLASSES AS c ON b.TS_LINE_CLASS_UID =
c.TS_LINE_CLASS_UID INNER JOIN
dbo.MSP_TIMESHEET_ACTUALS AS d ON b.TS_LINE_UID = d.TS_LINE_UID
INNER JOIN
dbo.MSP_RESOURCES AS e ON a.RES_UID = e.RES_UID INNER JOIN
dbo.msp_tasks as f ON b.task_uid = f.task_uid
WHERE (c.TS_LINE_CLASS_TYPE = 0) AND
(a.TS_STATUS_ENUM = 3) AND
(d.TS_ACT_VALUE + d.TS_ACT_NON_BILLABLE_VALUE > 0) AND
YEAR(d.TS_ACT_START_DATE) = 2008 AND
MOnth(d.TS_ACT_START_DATE) = 1
order by b.TS_LINE_CACHED_PROJ_NAME
The purpose of the first query is to actually extract all timesheet line
records approved for timesheet class type=0 (tasks related to project plans)
and the timesheet being approved (status=3) for January 2008.
The purpose of the second query is to actually link the timesheet_lines
results with the tasks table to enable me in retrieving more information
about the specific tasks that a timesheet was linked to.
This gives me the impression that there is actually tasks in the timesheet
lines table with a specific task_uid, and the corresponding task_uid in the
tasks table does not exist. Any help on this would be appreciated.
SELECT distinct b.TS_LINE_CACHED_PROJ_NAME AS
view_ts_proj_noaxapta_projectname,
b.TS_LINE_CACHED_ASSIGN_NAME AS view_ts_proj_noaxapta_taskname
FROM dbo.MSP_TIMESHEETS AS a INNER JOIN
dbo.MSP_TIMESHEET_LINES AS b ON a.TS_UID = b.TS_UID INNER JOIN
dbo.MSP_TIMESHEET_CLASSES AS c ON b.TS_LINE_CLASS_UID =
c.TS_LINE_CLASS_UID INNER JOIN
dbo.MSP_TIMESHEET_ACTUALS AS d ON b.TS_LINE_UID = d.TS_LINE_UID
INNER JOIN
dbo.MSP_RESOURCES AS e ON a.RES_UID = e.RES_UID
WHERE (c.TS_LINE_CLASS_TYPE = 0) AND
(a.TS_STATUS_ENUM = 3) AND
(d.TS_ACT_VALUE + d.TS_ACT_NON_BILLABLE_VALUE > 0) AND
YEAR(d.TS_ACT_START_DATE) = 2008 AND
MOnth(d.TS_ACT_START_DATE) = 1
except
SELECT distinct b.TS_LINE_CACHED_PROJ_NAME AS
view_ts_proj_noaxapta_projectname,
b.TS_LINE_CACHED_ASSIGN_NAME AS view_ts_proj_noaxapta_taskname
FROM dbo.MSP_TIMESHEETS AS a INNER JOIN
dbo.MSP_TIMESHEET_LINES AS b ON a.TS_UID = b.TS_UID INNER JOIN
dbo.MSP_TIMESHEET_CLASSES AS c ON b.TS_LINE_CLASS_UID =
c.TS_LINE_CLASS_UID INNER JOIN
dbo.MSP_TIMESHEET_ACTUALS AS d ON b.TS_LINE_UID = d.TS_LINE_UID
INNER JOIN
dbo.MSP_RESOURCES AS e ON a.RES_UID = e.RES_UID INNER JOIN
dbo.msp_tasks as f ON b.task_uid = f.task_uid
WHERE (c.TS_LINE_CLASS_TYPE = 0) AND
(a.TS_STATUS_ENUM = 3) AND
(d.TS_ACT_VALUE + d.TS_ACT_NON_BILLABLE_VALUE > 0) AND
YEAR(d.TS_ACT_START_DATE) = 2008 AND
MOnth(d.TS_ACT_START_DATE) = 1
order by b.TS_LINE_CACHED_PROJ_NAME