473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Tree Structure Query / Report - MS Access

1
Sir,
I have a table named "RELATIONS_MASTER". Content of the table is below.

CODE | PARENT | CHILD | LEVEL |
--------------------------------------------------------------
A01 | Red Bull | Red Eye | 01
B01 | Blue River | Blue Gun | 01
A11 | Red Eye | Red Sand | 02
A21 | Red Sand | Red Rock| 03
B11 | Blue Gun | Blue Bell | 02
B21 | Blue Bell | Blue Net | 03
B31 | Blue Net | Blue June | 04
......


I need a Query / report in the following form

A01 - Red Bull
|_ A11 - Red Eye
|_ A21 - Red Sand
|_ A 31 - Red Rock ...........
|_ .....

B01 - Blue River
|_ B11 - Blue Gun
|_ B 21 - Blue Bell
|_ B31 - Blue Net
|_ B41 - Blue June


Any body can help me! Urgent Please...

Regards,

Vivek
Feb 14 '08 #1
1 4061
FishVal
2,653 Expert 2GB
Hi, Vivek.

I have several things to pay your attention to:
  • first of all please specify whether a child may have one, fixed number or infinite parents
  • [Level] field is not really needed to support the tree, moreover it is a duplicate information which may increase performance working as cache but needs to be synchronized with possible changes in tree structure
  • Do you have a root node of the tree (a single node which has no parents)?
  • It is rather simple to output the tree to a text file, spreadsheet or Word document. Making a query/report may be somewhat difficult especially if number of parents for child is not limited to one.
  • And the last but not the least. Post your table(s) metadata.
    Here is an example of how to post table MetaData :
    Table Name=tblStudent
    Expand|Select|Wrap|Line Numbers
    1. Field; Type; IndexInfo
    2. StudentID; AutoNumber; PK
    3. Family; String; FK
    4. Name; String
    5. University; String; FK
    6. Mark; Numeric
    7. LastAttendance; Date/Time
    It is not clear from what you've posted so far whether [Parent] and [Child] fields are FKs of another table or not.

Regards,
Fish
Feb 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Michael Malinsky | last post by:
I'm attempting to create a database which will take information from one (perhaps two) tables and utilize that information to return queries to a report designed in Excel. The general idea I...
12
by: pillepop2003 | last post by:
Hey! Can anyone give me a hint, how this problem is best implemented: I have a table of users (see below), where every user has one "superior user" (= parent node), this should be a fully...
4
by: plork | last post by:
I'm trying to code a tree structure using javascript, the nodes of the tree are generated from a sql table. Has anyone some code for this? Cheers
4
by: Ken | last post by:
I have a binary tree in VB NET and insertions seem to be slow. The program receives data from one source and inserts it into the tree. The program receives data from another source and...
1
by: David Hirschfield | last post by:
I've written a tree-like data structure that stores arbitrary python objects. The objective was for the tree structure to allow any number of children per node, and any number of root nodes...and...
0
by: abhishekjethwani | last post by:
How to write a query to access tree structure form multi table. I m having five tables from them first table give me a data which act as the parameter for query for the second table and the two...
6
by: Travis | last post by:
Is there a community accepted best way to store a menu tree for an interface in a data structure. Ideally I would like something that searches fast so given a menu structure like this File / ...
8
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from...
1
by: dhettlinger | last post by:
I'm attempting to write some SQL code in Oracle 10g to pull data from a tree structure. Basically, I have a users table, and each user is assigned to a manager. (The user's manager's ID is kept in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.