Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Getting 2groups of emps in1 rpt. Post Reply Post New Topic
Author Message
JMAO
Newbie
Newbie


Joined: 14 Jan 2014
Online Status: Offline
Posts: 9
Quote JMAO Replybullet Topic: Getting 2groups of emps in1 rpt.
     Posted: 15 Jan 2014 at 7:20am

Having a problem getting 2 employee groups in one report.  I have to send a areport showing

1.) emps that had a deduction in a particular pay period ( active and terminated).
2.) emps who are active and eligible for a deduction, but didn't have one taken. 
 
My code is only pulling in those employees with a deduction (755) ignoring the active population without a deduction (1252).  I tried doing a variable for the pay period data ( pay date, deduction amout) for the pay period data that is stored in a file where employees can have up to 15 deductions.  Emps without a deduction are being pulled from a file with only one record per person.  I tried putting the active staff in an application group so there was less to code in the report. 
 
({PAYDEDUCTN.CHECK_DATE} in DateTime (2013, 12, 28, 00, 00, 00) to DateTime (2014, 01, 10, 00, 00, 00) and
{PAYDEDUCTN.DED_CODE} in ["7554", "7555"])
or
{PGEMPLOYEE.GROUP_NAME}= "ZMET"
 
Thanks for any help that can be given. 

 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Jan 2014 at 10:10am
sometime, a subreport is the way to go...as it will easily separate the data.

another option is to use a stored proc to gather your data, and I know that not every report writer is allowed to create a stored procs or that they may not know how to , so this tends to be an iffy proposition.

Hope one of these ideas helps
IP IP Logged
JMAO
Newbie
Newbie


Joined: 14 Jan 2014
Online Status: Offline
Posts: 9
Quote JMAO Replybullet Posted: 16 Jan 2014 at 3:27am

I appreciate the feedback.  I am researching training material on each of your recommendations.  If I can document a stored procedure approach, I hope to go to the (IT) manager of the  area to get the necessary permissions needed to create it.  Thank you!

IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 16 Jan 2014 at 5:50am
you could also try a command option
it would be someting like

select 'active and terminated' as amps_group ,
field1, field2..

from table
where table.employee ( active and terminated)
union all
select 'active and eligible' as amps_group ,
field1, field2..

from table
where table.employee (active and eligible)

this is a structure example!
you can see what your current pull looks like in sql
at database tab>> show SQL Query.
IP IP Logged
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