Roll-Up and Aggregate query

G

Guest

I have an MS-Access lookup table that contains various categories and

subcategories. The fields are:

-------------------------------------------------
tblCategory:

CategoryID (Prime Key) -- Autonumber, indexed
Category_Description -- text
fkParentID (Foreign Key pointing to tblCategory.CategoryID) -- Long

integer

I have another table that assigns costs to some subset of the "child"

categories.

tblCost:
CostID (Prime Key) -- Autonumber, indexed
fkCategoryID -- (Foreign Key pointing to tblCategory.CategoryID)
Cost -- currency
-------------------------------------------------

I need to create a select query that shows:

Category_Description
Cost

Here is the "catch". The query needs to show all the children and

their parents simultaneously with child costs "rolled up" and

assigned to their parents, recursively all the way to the "root node"

with the parents and children sorted in hierarchical order.

When I was working with SQL-Server, I seem to remember a way of doing

this without coding.

QUESTION: Is there a preferred way to do this in MS-Access?
 

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