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

complex report / query

jlm
I believe that I need to create a temp table to hold data at runtime.
Can someone give me information where I can find out more about temp
tables?

basics --
a user of my Leave Tracking db can either be a supervisor or an
employee. If the user is an employee, I want to print out only their
leave data. If the user is a supervisor, I want to be able to print
out their's as well as all of their employee's leave data.

Tables are on a SQL server.

more details --
I have a "reports" form which has an OnOpen event to capture the
NTUserName, from that I can capture their UserID and their
supervisor's ID, and whether they are a supervisor or just an
employee. The temp table would hold the user's ID and any employee
IDs that this employee may have under them. I thought that by
creating a temp table to hold all employee/supervisor IDs, I could use
this to print out any cascading information on any
employee/supervisor.

If the user is a supervisor, I want to be able to loop through my
Employee table to capture all of their employees and use that list in
a query that brings up all the leave hours used and accrued (each
record in this table has EmployeeID, their SupervisorID, and a
checkbox to determine if they are a supervisor).

Some employees are supervisors have supervisors under them. In this
case, the head supervisor should be able to look at the leave hours of
their supervisors and all of their supervisor's employees.

I really hope this makes sense.

tia,
JMorrell
Nov 13 '05 #1
1 1238
Maybe I'm misremembering, but I thought this was an adjacency list
problem. You might want to look up Joe Celko's posts on the subject
in this NG. There here somewhere, and well worth reading. IIRC, the
problem is populating the entire list of supervisor/staff hierarchies.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: | last post by:
I am trying to run the following agregate function in a parameterized query on Access2000: Min(.*sqr(./.)/) The query saved OK, but an attempt to run it results in the message: The expression...
6
by: Mahesh Hardikar | last post by:
Hi , Oracle 8.1.7.0.0 on HP-UX 11.0 I am a newbie as far as PL-SQL is concerned . I have Sybase/MSSQL T-SQL background. We have a report which uses a select statement . This select...
3
by: AstrA | last post by:
Hi All Wondered if you could help. Basically I have 2 tables that contain all the data I want for my report, but I need to put it in a particular way and I need to display it in an ASP page...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
0
by: Richard Sherratt | last post by:
I'm printing address labels in a membership database. The rules are that if both MailingAddress1 and MailingAddress2 are Null, then use home address, otherwise use mailing address. If address line...
8
by: Matt | last post by:
Hi all, Thank you for taking the time. I have a database with 45 tables on it. 44 tables are linked to a main table through a one to one relationship. My question is, is there no way i can...
3
by: Wired Hosting News | last post by:
Lets say I have 10 products in 10 different stores and every week I get a report from each store telling me how many items they have left for each of the 10 products. So each week I enter in 100...
5
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
1
by: Randy Volkart | last post by:
I'm trying to fix a glitch in a complex access database, and have a fairly complex problem... unless there's some obscure easy fix I don't know being fairly new with Access. Basically, the area...
2
BeemerBiker
by: BeemerBiker | last post by:
I put together a (what I consider) complex query using the Access wizard. It works fine in access but fails when I code it up. I can actually make it work in code by "simplifying" it, but then it...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.