Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need results even if zeros Post Reply Post New Topic
Author Message
gwendoll
Newbie
Newbie


Joined: 08 Dec 2009
Location: United States
Online Status: Offline
Posts: 1
Quote gwendoll Replybullet Topic: Need results even if zeros
    Posted: 08 Dec 2009 at 11:36am

I am working on an urgent report where I have to show the amout of "PTO" each employee has taken with a certain time period.  I can get the records of the employees that have taken time with no problem but since I am using a date range I am having a very difficult time getting the names back who have not used any time. I have tried full outer joins, right outer joins and left outer joins and nothing is working.  I have also tried a sub report but I can never get the right name in the right place.

The table is set up like this:

NAME           Hours Taken      DateTaken

BOB                    8.0                  11/01/2009

I am using Crystal XI  on BOXI R2 SP4 any and all help appreciated!     

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Dec 2009 at 12:18pm
I assume you are using Date parameters in your select statement to filter the dates.
That will supercede any join you do (and exclude peopel that do not have any recorsds in that date range).
You could not filter on the dates,
group on the employee
Suppress details that do not fall in your date range
create a formula field for hours  (if date in ?startdate to ?enddate then hoursfield else 0) and SUM it per employee or use a RT to only count those records.
 


Edited by DBlank - 08 Dec 2009 at 12:19pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Dec 2009 at 1:58pm
Or you can do a complex selection criteria - I'm assuming that the Employee and PTO info is in separate tables.  You would left outer join from Employee to PTO and then, in the record selection criteria, put something like:
 
({PTO.DateField} between <start date> and <end date>
OR
IsNull({PTO.employee key field}))
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.017 seconds.