Conditional Printing

J

JWeaver

I have a report that prints employee detail for work that is submitted for
every payroll period. I want another report that will print the same detail
information but for ONLY those employees who submit more than 80 hours for
that payroll. This is a backup tool to ensure that the hours worked cover
more than a 2 week period.

How do I set this up?
 
J

Jeff Boyce

If this were mine, I'd first create a query to find employees with >80 hours
worked. Then I'd use that query, joined to a new one, to get the "details"
for those employees.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JWeaver

I tried that but the query displayed all records when I asked for hours > 80.
The employee may work with more than one client and it is the total of
these hours that I am concerned with.

The report sums the hours for the weeks on this payroll. I have it set up
to highlight those that total over 80 hours. This works properly and it is
these that I need the detail for on a separate report.
 
J

Jeff Boyce

Consider posting the SQL of that "first" query. Depending on how your data
is structured, it should be possible.

Also consider describing how your data is structured ... it all starts with
the data, and "how" depends on how your data is organized.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JWeaver

Here is the SQL of the query:

SELECT [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Other, [Wrap Payroll].Program,
[Wrap Payroll].Last, [Wrap Payroll].First, [Wrap Payroll].[Emp #], [Wrap
Payroll].[Pay Rate], [Wrap Payroll].[Con Hours], [Wrap Payroll].[Con Date],
[Wrap Payroll].From, [Wrap Payroll].To, [Wrap Payroll].Hours, Sum([Wrap
Payroll].Hours) AS [Sum of Hours], [Wrap Payroll].Note, [Wrap Payroll].ID
FROM [Wrap Payroll]
GROUP BY [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Other, [Wrap Payroll].Program,
[Wrap Payroll].Last, [Wrap Payroll].First, [Wrap Payroll].[Emp #], [Wrap
Payroll].[Pay Rate], [Wrap Payroll].[Con Hours], [Wrap Payroll].[Con Date],
[Wrap Payroll].From, [Wrap Payroll].To, [Wrap Payroll].Hours, [Wrap
Payroll].Note, [Wrap Payroll].ID
HAVING ((([Wrap Payroll].[PPE Date])=[Enter Pay Period Ending Date (Friday)]))
ORDER BY [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Program, [Wrap Payroll].Last, [Wrap
Payroll].First;
 
J

Jeff Boyce

I see nothing in the SQL that totals up the hours to check against 80.

Regards

Jeff Boyce
Microsoft Office/Access MVP


JWeaver said:
Here is the SQL of the query:

SELECT [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Other, [Wrap Payroll].Program,
[Wrap Payroll].Last, [Wrap Payroll].First, [Wrap Payroll].[Emp #], [Wrap
Payroll].[Pay Rate], [Wrap Payroll].[Con Hours], [Wrap Payroll].[Con
Date],
[Wrap Payroll].From, [Wrap Payroll].To, [Wrap Payroll].Hours, Sum([Wrap
Payroll].Hours) AS [Sum of Hours], [Wrap Payroll].Note, [Wrap Payroll].ID
FROM [Wrap Payroll]
GROUP BY [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Other, [Wrap Payroll].Program,
[Wrap Payroll].Last, [Wrap Payroll].First, [Wrap Payroll].[Emp #], [Wrap
Payroll].[Pay Rate], [Wrap Payroll].[Con Hours], [Wrap Payroll].[Con
Date],
[Wrap Payroll].From, [Wrap Payroll].To, [Wrap Payroll].Hours, [Wrap
Payroll].Note, [Wrap Payroll].ID
HAVING ((([Wrap Payroll].[PPE Date])=[Enter Pay Period Ending Date
(Friday)]))
ORDER BY [Wrap Payroll].[PPE Date], [Wrap Payroll].[Advocate Last], [Wrap
Payroll].[Advocate First], [Wrap Payroll].Program, [Wrap Payroll].Last,
[Wrap
Payroll].First;

--
JWeaver


Jeff Boyce said:
Consider posting the SQL of that "first" query. Depending on how your
data
is structured, it should be possible.

Also consider describing how your data is structured ... it all starts
with
the data, and "how" depends on how your data is organized.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top