473,750 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tree Structure Query / Report - MS Access

1 New Member
Sir,
I have a table named "RELATIONS_MAST ER". 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 4083
FishVal
2,653 Recognized Expert Specialist
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
4206
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 have is this: The "primary" or "source" table is easy. This is a trial balance (account number as a primary key, description, amount). I'll need table(s) to denote which account numbers belong to which
12
6991
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 unambigous tree structure. The root node can have whatever value you prefer, I suppose NULL would be good for a start. What I want to do is finding the way from an arbitrary node in the tree. Example:
4
4817
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
2949
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 looks the data up in the tree.
1
2748
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 for it to be speedy for trees with thousands of nodes. At its core, the structure is just a list of lists arranged so that if node A has children B and C and node B has child D the data looks like: A = B =
0
2553
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 tables will give me parameter for the third and so on. at present i m writing five query and sending parameter to each query but i want an efficient way for this. its a parent child type relation.
6
6164
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 / | \ / | \ Print Exit Edit / \ Copy Paste
8
1801
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 a slow distant site). - But you want to be able to request data from it, such has "give me all nodes that are under a "//foo/bar" tree, and have a child with an "baz" attribute of value "zzz". Question :
1
3440
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 the manager field of the user's entry in the users table.) From this tree structure, I want to pull a list of all users who report either directly or indirectly to a particular division head (top level manager). I imagine that this query would...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.