January 12, 2014 at 12:59 am
I have the below VIEW that I now want to use the selected columns to UPDATE another table with the same 'ProjectId'..
Can anyone assist me please ?
SELECT project.id AS projectId, task.id AS taskId, [task-assignment].[hourly-rate] * [task-assignment].budget AS BudgetValue,
[task-assignment].[hourly-rate] * SUM(dayentry.hours) AS ActualValue, SUM(dayentry.hours) AS ActualHours, [task-assignment].budget AS BudgetHours
FROM dbo.[task-assignment] AS [task-assignment] INNER JOIN
dbo.project AS project ON [task-assignment].[project-id] = project.id INNER JOIN
dbo.task AS task ON [task-assignment].[task-id] = task.id FULL OUTER JOIN
dbo.dayentry AS dayentry ON project.id = dayentry.[project-id] AND task.id = dayentry.[task-id]
WHERE (project.[bill-by] = 'Tasks') AND ([task-assignment].billable = 1)
GROUP BY project.id, task.id, [task-assignment].[hourly-rate], [task-assignment].budget
January 12, 2014 at 9:32 am
This is a duplicate post. No replies on this thread, please. It just splits the answers up. Please refer to the following URL to get to the other post. Thanks.
http://www.sqlservercentral.com/Forums/Topic1530081-391-1.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply