Conditional calculcation

G

Guest

I have a table of projects that includes cost. A second table contains a
subset of projects that includes the project ID (matching the first table),
group and percentage to be multiplied by the project cost. I would like a
query that returns all projects, providing multiple lines for those projects
that are to broken out. I'm just not sure how to relate the tables and what
formulae to use.

Table 1
Project ID
Project Description
Project Cost

Table 2
Project ID
Group ID
Percent of Project

Any help would be appreciated!!
 
J

John Spencer

SELECT T1.[Project Id], T1.[Project Description], T1.[Project Cost]
, T2.[Group ID], T1.[Project Cost] * T2.[Percent of Project] as GroupCost
FROM [Table 1] as T1 LEFT JOIN [Table 2] as T2

In the grid
--add both tables
--Drag from Table1 Project ID to Table 2 Project ID
--Double click the Join line and select all from Table 1 and only from Table
2
--Add the fields you want to see
--Make a calculated field for the group cost

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top