473,396 Members | 1,755 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,396 software developers and data experts.

Hierarchical Problem - How can I create a query for this?

I have a problem on how I the query be stated in this situation:

Area Manager 1 Priority 9
Area Manager 2 Priority 9

Branch Manager 1 under Area Mgr1 Priority 8
Branch Manager 2 under Area Mgr1 Priority 8

Branch Manager 3 under Area Mgr2 Priority 8
Branch Manager 4 under Area Mgr2 Priority 8

Sales 1 under Branch Mgr1 Priority 7
Sales 2 under Branch Mgr1 Priority 7

Sales 3 under Branch Mgr2 Priority 7
Sales 4 under Branch Mgr2 Priority 7

Sales 5 under Branch Mgr3 Priority 7


I would need to make the current user view reports made by himself and those under him(priorities less than the user's). I have made some ' almost ok' queries, but they still see other's reports.

ex. Area Manager 1 should only see BM1 & BM2, and Sales 1-4
ex2. BM1 should only see BM1 & Sales 1&2

Thanks!!!
Sep 14 '07 #1
1 1330
r035198x
13,262 8TB
I have a problem on how I the query be stated in this situation:

Area Manager 1 Priority 9
Area Manager 2 Priority 9

Branch Manager 1 under Area Mgr1 Priority 8
Branch Manager 2 under Area Mgr1 Priority 8

Branch Manager 3 under Area Mgr2 Priority 8
Branch Manager 4 under Area Mgr2 Priority 8

Sales 1 under Branch Mgr1 Priority 7
Sales 2 under Branch Mgr1 Priority 7

Sales 3 under Branch Mgr2 Priority 7
Sales 4 under Branch Mgr2 Priority 7

Sales 5 under Branch Mgr3 Priority 7


I would need to make the current user view reports made by himself and those under him(priorities less than the user's). I have made some ' almost ok' queries, but they still see other's reports.

ex. Area Manager 1 should only see BM1 & BM2, and Sales 1-4
ex2. BM1 should only see BM1 & Sales 1&2

Thanks!!!
What is the table structure?
Can you describe the results that you want the query to return
Sep 14 '07 #2

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

Similar topics

2
by: Reimar Bauer | last post by:
Hi all, I would like to use a hierarchical group oriented encryption. Is there something implemented or did you know something I could use? For explanaition. If you have a large building...
1
by: ALEX KLEIN | last post by:
I want to use fabricated hierarchical recordset in VB6 using ADO. I wrote code like dim rs as adodb.recordest set rs=new adodb.recordest rs.fields.append "a1",adChar,30 Then in loop I put...
0
by: Mike N. | last post by:
Hello to all: First let me apologize for the length of this question, I've made an attempt to include as much information as is needed to help with the question. I am having problems putting...
3
by: Cláudia Morgado | last post by:
Hello! Oracle has the option with the SQL CONECT BY statement to run through a hierarchical database with a single SQl-statement: <!--SQL SELECT ms_id,ms_parent FROM messages CONNECT BY PRIOR...
13
by: Anton.Nikiforov | last post by:
Hello everybody! Does someone know how to build hierarchical queries to the postgresql? I have a table with tree in it (id, parent) and need to find a way from any point of the tree to any...
1
by: News Server | last post by:
Any help appreciated. I have two Access tables, customer and orders. I would like to create a truly hierarchical xml file form the joined tables. I need to produce: <Query1> <Customer>...
4
by: Daisy | last post by:
Let's say I've got a forum, where users can be moderators of each forum. Tables look like this: USER -------- user_key name FORUM
5
by: clintonG | last post by:
I'm looking for documentation and would not turn my nose up to any code from anybody who thinks they are good at the design of an algorythm that can be used to generated a hierarchical relational...
3
by: Bennett Haselton | last post by:
I want to display a hierarchical listing of items from a database table, where, say, each row in the table has an "ID" field and a "parent_id" field giving the ID of its parent (NULL if it's at the...
12
by: Steve | last post by:
I have been studying the Adjacency List Model as a means of achieving a folder structure in a project I am working on. Started with the excellent article by Gijs Van Tulder ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.