A
Aaron
Hi, got a problem with a subquery - hope someone can help
me out!
Say I have a table. The important fields are ID, ParentID
& Height.
I have built a query with a subquery linked using ID-
ParentID.
So the resulting datsheet ID's looks something like this:
1
|-2
| |
| |-3
| |-4
|
|-5
|-6
I want to have culminative values of the height field
(short number). So that there is a field in record "1"
that has the total value of all its sub-records.
So in the case of:
| ID | ParentID | Height | CulminativeHeight |
----------------------------------------------
| 1 | - | 10 | 26 |
| 2 | 1 | 5 | 4 |
| 3 | 2 | 2 | 0 |
| 4 | 2 | 2 | 0 |
| 5 | 1 | 5 | 2 |
| 6 | 5 | 2 | 0 |
How can I achieve the CulminativeHeight Field? (It must be
available for all records, even those without child sub-
records will need a value of 0).
Anyone go any ideas? Cheers,
Aaron
me out!
Say I have a table. The important fields are ID, ParentID
& Height.
I have built a query with a subquery linked using ID-
ParentID.
So the resulting datsheet ID's looks something like this:
1
|-2
| |
| |-3
| |-4
|
|-5
|-6
I want to have culminative values of the height field
(short number). So that there is a field in record "1"
that has the total value of all its sub-records.
So in the case of:
| ID | ParentID | Height | CulminativeHeight |
----------------------------------------------
| 1 | - | 10 | 26 |
| 2 | 1 | 5 | 4 |
| 3 | 2 | 2 | 0 |
| 4 | 2 | 2 | 0 |
| 5 | 1 | 5 | 2 |
| 6 | 5 | 2 | 0 |
How can I achieve the CulminativeHeight Field? (It must be
available for all records, even those without child sub-
records will need a value of 0).
Anyone go any ideas? Cheers,
Aaron