Duplicate records in Report

Thecherub

Man with a Mission
Local time
Today, 09:09
Joined
Jan 14, 2004
Messages
92
This may seem strange but i've got a two tables with similar Data one is for History Dates the other is for Future dates. I am trying to get the report to Show the totals or each. But in my report i keep getting both the History and Currents multiple times. And i can't for the life of me fugure out how to stop it. The Querys work fine when they are seperate but combined they just won't function right.

Any help would be appreaciated.
 
What you are getting is "Non Distinct Row's".

I have trouble with them form time to time.

Let me ask you this, is the data that you are pulling into the query form the same table?
If it is that will be where your problem is, if you are calling data from the same table or with the same criteria you are going to get problems.

If they are not from the same table try going into the query is SQL view and type DISTINCT just after the SELECT key word. That may fix it depending on how you have you tables and query set up.

To get around this perhaps you could try setting up two queries one for one date and another for the other.

Then bring the information onto a report through a SubReport.

With little information here as to the structure of your database I hope this helps. :)
 
Here is more Info

The Tables are

Employee Info - Employee #, Last name, First Name, Department, Date of Hire. Terminated (Y\N)
Time Off History - Fields Employee #(one to many with Employee info), Type Of Time (Vac, Leave of Absence app, LOA Denied. and LOW)(List) and Date of Time off)
Time off Current the Same as History

I'm not using a Key word because the powers that be want all the Info displayed

What it the Difference bettween Joining and Unioning?

I'd include the database but I can't get it small Enuff.

Thanks for the help so far i'll try Subreports and see if that helps
 
SQL Posting

Here's a stupid Question, How does one post their SQL

:confused:
 
Open the query in design view, switch to SQL on the toolbar, copy and paste here
 
Well here it is

The SQL of the Query

SELECT [Employee List].Department, [Employee List].[Last Name], [Employee List].[First Name], [Time Off History].[Time Off History], Count([Time Off History].[Time Off History]) AS [CountOfTime Off History], [Time Off History].[Date Booked], [Time off Booked].[Time Off Booked], Count([Time off Booked].[Time Off Booked]) AS [CountOfTime Off Booked], [Time off Booked].[Date Booked]
FROM ([Employee List] INNER JOIN [Time Off History] ON [Employee List].[Employee Number] = [Time Off History].[Employee Number]) INNER JOIN [Time off Booked] ON [Employee List].[Employee Number] = [Time off Booked].[Employee Number]
GROUP BY [Employee List].Department, [Employee List].[Last Name], [Employee List].[First Name], [Time Off History].[Time Off History], [Time Off History].[Date Booked], [Time off Booked].[Time Off Booked], [Time off Booked].[Date Booked];
 
Ok I see

So the Layout would be

Main Report - Employee Info(from Table)
Sub Report1 - Time off history
Sub report 2 - Time off current

Should i use the Tables for the subreports and then do the Counts and other calulations on the subreports or use Queries to form the subreports? It seems to me that it should work both ways.

But thank you for the help so far now i have to play with formating

Fun wow........
 
Ok mow a new problem

Ok the repeating data problem is no more.

But I have a new Problem.

in my Sub-report I have the following

Field 1 Time off History
Field 2 Count of Time off History
Field 3 Date Booked

So far so good the problem is Time off History is a list box and i need to total each item in the list.

Would I use grouping and sorting for this or is there another way.

The help so far has been wounderful and I thank the community as a whole.
 
Witch footer

Should the Counter go in the Page Footer or the Report Footer

and Ialready have a Count in the report shouldn't I be using a Sum of the count? :confused:

The Sub report has 3 fields:

Time off Booked (list box(LOA, TOA, TOD, LOW))
Count of Time off Booked
Date of time off booked

I have to Total the count for each item in the list box.

so if there are 2 LOA's I need a Subtotal for that.

EDIT(after playing with it)

It is a count i forgot to put in a group footer. Now it works.

Thanks much I'm almost done this database now.
 
Last edited:
Ok a new Problem

I've got my Report and the Sub reports

The main report Collums are

Department, Last Name, First Name Vacation Elegibility

The Sub Reports are

Record of time off History and Record of Time off Booked

I need to add 2 colums to the Main one that will add the Total Vacation Days in History and Booked. the 2nd is easy once the first is done it's for the Difference bettween the two. I need to show how many Vacation days are left because Leaves of Absence cannot be taken while any vacation time is remaining.

Can someone help me with this i've got the Querys set up but when i try to add them to the report i get Conflict errors.
 

Users who are viewing this thread

Back
Top Bottom